diff --git a/Localizable.xcstrings b/Localizable.xcstrings index 8f9fe742..1656a3f4 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -334,9 +334,6 @@ }, "Ack Time: %@" : { - }, - "Acknowledged" : { - }, "Acknowledged by another node" : { @@ -6700,9 +6697,6 @@ }, "Drag & Drop is the recommended way to update firmware for NRF devices. If your iPhone or iPad is USB-C it will work with your regular USB-C charging cable, for lightning devices you need the Apple Lightning to USB camera adaptor." : { - }, - "Each node is an available contact. Contacts with recent messages or marked as favorites show up at the top of the list. Select a contact to send or view messages. Long press to favorite or mute the contact or delete the conversation." : { - }, "echo" : { "localizations" : { @@ -7209,6 +7203,9 @@ }, "Favorites" : { + }, + "Favorites and nodes with recent messages show up at the top of the list. Contacts using the shared key display an open lock, nodes with a private key show a green lock and a red key with a slash will show up if a key has changed for a contact. Long press to favorite or mute the contact or delete a conversation." : { + }, "Fifteen Minutes" : { @@ -18446,7 +18443,18 @@ "en" : { "stringUnit" : { "state" : "translated", - "value" : "PKI Failed" + "value" : "Encrypted Send Failed" + } + } + } + }, + "routing.pkiunknownpubkey" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Unknown Public Key" } } } diff --git a/Meshtastic/Enums/RoutingError.swift b/Meshtastic/Enums/RoutingError.swift index 50de17a5..6dc83692 100644 --- a/Meshtastic/Enums/RoutingError.swift +++ b/Meshtastic/Enums/RoutingError.swift @@ -5,6 +5,7 @@ // Copyright(c) Garth Vander Houwen 8/4/22. // import Foundation +import SwiftUI import MeshtasticProtobufs enum RoutingError: Int, CaseIterable, Identifiable { @@ -22,6 +23,7 @@ enum RoutingError: Int, CaseIterable, Identifiable { case badRequest = 32 case notAuthorized = 33 case pkiFailed = 34 + case pkiUnknownPubkey = 35 var id: Int { self.rawValue } var display: String { @@ -53,6 +55,41 @@ enum RoutingError: Int, CaseIterable, Identifiable { return "routing.notauthorized".localized case .pkiFailed: return "routing.pkiFailed".localized + case .pkiUnknownPubkey: + return "routing.pkiunknownpubkey".localized + } + } + var color: Color { + switch self { + + case .none: + return Color.secondary + case .noRoute: + return Color.red + case .gotNak: + return Color.red + case .timeout: + return Color.orange + case .noInterface: + return Color.red + case .maxRetransmit: + return Color.red + case .noChannel: + return Color.orange + case .tooLarge: + return Color.red + case .noResponse: + return Color.orange + case .dutyCycleLimit: + return Color.orange + case .badRequest: + return Color.red + case .notAuthorized: + return Color.red + case .pkiFailed: + return Color.red + case .pkiUnknownPubkey: + return Color.red } } func protoEnumValue() -> Routing.Error { @@ -85,6 +122,8 @@ enum RoutingError: Int, CaseIterable, Identifiable { return Routing.Error.notAuthorized case .pkiFailed: return Routing.Error.pkiFailed + case .pkiUnknownPubkey: + return Routing.Error.pkiFailed } } } diff --git a/Meshtastic/Resources/DeviceHardware.json b/Meshtastic/Resources/DeviceHardware.json index 09eb2e6c..cbad8df9 100644 --- a/Meshtastic/Resources/DeviceHardware.json +++ b/Meshtastic/Resources/DeviceHardware.json @@ -370,7 +370,7 @@ { "hwModel": 66, "hwModelSlug": "HELTEC_VISION_MASTER_T190", - "platformioTarget": "heltec-vision-master-T190", + "platformioTarget": "heltec-vision-master-t190", "architecture": "esp32-s3", "activelySupported": true, "displayName": "Heltec Vision Master T190" diff --git a/Meshtastic/Tips/MessagesTips.swift b/Meshtastic/Tips/MessagesTips.swift index d78daa0e..5bd50d54 100644 --- a/Meshtastic/Tips/MessagesTips.swift +++ b/Meshtastic/Tips/MessagesTips.swift @@ -38,7 +38,7 @@ struct ContactsTip: Tip { } var message: Text? { // Text("tip.messages.contacts.message") - Text("Each node is an available contact. Contacts with recent messages or marked as favorites show up at the top of the list. Select a contact to send or view messages. Long press to favorite or mute the contact or delete the conversation.") + Text("Favorites and nodes with recent messages show up at the top of the list. Contacts using the shared key display an open lock, nodes with a private key show a green lock and a red key with a slash will show up if a key has changed for a contact. Long press to favorite or mute the contact or delete a conversation.") } var image: Image? { Image(systemName: "person.circle") diff --git a/Meshtastic/Views/Messages/ChannelMessageList.swift b/Meshtastic/Views/Messages/ChannelMessageList.swift index b996e790..95b727f0 100644 --- a/Meshtastic/Views/Messages/ChannelMessageList.swift +++ b/Meshtastic/Views/Messages/ChannelMessageList.swift @@ -84,16 +84,14 @@ struct ChannelMessageList: View { } HStack { - if currentUser && message.receivedACK { - // Ack Received - Text("Acknowledged").font(.caption2).foregroundColor(.gray) - } else if currentUser && message.ackError == 0 { + if currentUser && message.ackError == 0 { // Empty Error Text("Waiting to be acknowledged. . .").font(.caption2).foregroundColor(.orange) } else if currentUser && message.ackError > 0 { let ackErrorVal = RoutingError(rawValue: Int(message.ackError)) Text("\(ackErrorVal?.display ?? "Empty Ack Error")").fixedSize(horizontal: false, vertical: true) - .font(.caption2).foregroundColor(.red) + .foregroundStyle(ackErrorVal?.color ?? .red) + .font(.caption2) } else if isDetectionSensorMessage { let messageDate = message.timestamp Text(" \(messageDate.formattedDate(format: MessageText.dateFormatString))").font(.caption2).foregroundColor(.gray) diff --git a/Meshtastic/Views/Messages/UserList.swift b/Meshtastic/Views/Messages/UserList.swift index 4d7b2fd9..96dd398e 100644 --- a/Meshtastic/Views/Messages/UserList.swift +++ b/Meshtastic/Views/Messages/UserList.swift @@ -185,7 +185,7 @@ struct UserList: View { } } .listStyle(.plain) - .navigationTitle(String.localizedStringWithFormat("contacts %@".localized, String(users.count == 0 ? 0 : users.count - 1))) + .navigationTitle(String.localizedStringWithFormat("contacts %@".localized, String(users.count == 0 ? 0 : users.count))) .sheet(isPresented: $isEditingFilters) { NodeListFilter(filterTitle: "Contact Filters", viaLora: $viaLora, viaMqtt: $viaMqtt, isOnline: $isOnline, isPkiEncrypted: $isPkiEncrypted, isFavorite: $isFavorite, isEnvironment: $isEnvironment, distanceFilter: $distanceFilter, maximumDistance: $maxDistance, hopsAway: $hopsAway, roleFilter: $roleFilter, deviceRoles: $deviceRoles) } diff --git a/Meshtastic/Views/Messages/UserMessageList.swift b/Meshtastic/Views/Messages/UserMessageList.swift index 914fde3f..977c1686 100644 --- a/Meshtastic/Views/Messages/UserMessageList.swift +++ b/Meshtastic/Views/Messages/UserMessageList.swift @@ -78,7 +78,9 @@ struct UserMessageList: View { if currentUser && message.receivedACK { // Ack Received if message.realACK { - Text("\(ackErrorVal?.display ?? "Empty Ack Error")").font(.caption2).foregroundColor(.gray) + Text("\(ackErrorVal?.display ?? "Empty Ack Error")") + .font(.caption2) + .foregroundStyle(ackErrorVal?.color ?? Color.secondary) } else { Text("Acknowledged by another node").font(.caption2).foregroundColor(.orange) } @@ -87,7 +89,7 @@ struct UserMessageList: View { Text("Waiting to be acknowledged. . .").font(.caption2).foregroundColor(.yellow) } else if currentUser && message.ackError > 0 { Text("\(ackErrorVal?.display ?? "Empty Ack Error")").fixedSize(horizontal: false, vertical: true) - .font(.caption2).foregroundColor(.red) + .foregroundStyle(ackErrorVal?.color ?? Color.red) } } }