Only share messagable contacts

This commit is contained in:
Garth Vander Houwen 2025-05-25 09:25:58 -07:00
parent d84e437180
commit 16ad1ecfce
4 changed files with 17 additions and 10 deletions

View file

@ -17666,6 +17666,9 @@
}
}
}
},
"Messaging" : {
},
"Metric" : {
"localizations" : {
@ -32903,7 +32906,7 @@
"Unmessagable" : {
},
"Unmonitored or Infrastructure" : {
"Unmonitored" : {
},
"Unset" : {

View file

@ -15,7 +15,9 @@ extension NodeInfoEntity {
userProto.shortName = user.shortName ?? ""
userProto.hwModel = HardwareModel(rawValue: Int(user.hwModelId)) ?? .unset
userProto.isLicensed = user.isLicensed
userProto.isUnmessagable = false
if userProto.hasIsUnmessagable == true {
userProto.isUnmessagable = user.unmessagable
}
userProto.role = Config.DeviceConfig.Role(rawValue: Int(user.role)) ?? .client
userProto.publicKey = user.publicKey?.subdata(in: 0..<user.publicKey!.count) ?? Data()
}

View file

@ -154,13 +154,13 @@ struct NodeDetail: View {
if node.user?.unmessagable ?? false {
HStack {
Label {
Text("")
Text("Messaging")
} icon: {
Image(systemName: "iphone.slash")
.symbolRenderingMode(.multicolor)
}
Spacer()
Text("Unmonitored or Infrastructure")
Text("Unmonitored")
}
.accessibilityElement(children: .combine)
}

View file

@ -80,12 +80,14 @@ struct NodeList: View {
/// Allow users to mute notifications for a node even if they are not connected
if let user = node.user {
NodeAlertsButton(context: context, node: node, user: user)
Button(action: {
shareContactNode = node
isPresentingShareContactQR = true
}) {
Label("Share Contact QR", systemImage: "qrcode")
}
if !user.unmessagable {
Button(action: {
shareContactNode = node
isPresentingShareContactQR = true
}) {
Label("Share Contact QR", systemImage: "qrcode")
}
}
}
if let connectedNode {
/// Favoriting a node requires being connected