Merge pull request #944 from meshtastic/dm-lock-indicator

Dm lock indicator
This commit is contained in:
Garth Vander Houwen 2024-09-23 16:45:32 -07:00 committed by GitHub
commit 2a9ae23ba1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 23 deletions

View file

@ -21,21 +21,6 @@
},
": %d" : {
},
".dot" : {
},
".gauge" : {
},
".gradient" : {
},
".pill" : {
},
".text" : {
},
"(Re)define PIN_GPS_EN for your board." : {
@ -19139,6 +19124,9 @@
},
"Send" : {
},
"Send ${messageContent} to ${channelNumber}" : {
},
"Send a Group Message" : {

View file

@ -1687,7 +1687,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.5.6;
MARKETING_VERSION = 2.5.7;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
@ -1722,7 +1722,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.5.6;
MARKETING_VERSION = 2.5.7;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
@ -1754,7 +1754,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.5.6;
MARKETING_VERSION = 2.5.7;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -1787,7 +1787,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.5.6;
MARKETING_VERSION = 2.5.7;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View file

@ -652,6 +652,20 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
retained: decodedInfo.mqttClientProxyMessage.retained
)
mqttManager.mqttClientProxy?.publish(message)
} else if decodedInfo.payloadVariant == FromRadio.OneOf_PayloadVariant.clientNotification(decodedInfo.clientNotification) {
let manager = LocalNotificationManager()
manager.notifications = [
Notification(
id: UUID().uuidString,
title: "Firmware Notification",
subtitle: "\(decodedInfo.clientNotification.level)".capitalized,
content: decodedInfo.clientNotification.message,
target: "settings",
path: "meshtastic:///settings/debugLogs"
)
]
manager.schedule()
Logger.data.error("⚠️ Client Notification \((try? decodedInfo.clientNotification.jsonString()) ?? "JSON Decode Failure")")
}
switch decodedInfo.packet.decoded.portnum {
@ -680,9 +694,6 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
do {
disconnectPeripheral(reconnect: false)
try container.restorePersistentStore(from: databasePath)
context.refreshAllObjects()
let request = MyInfoEntity.fetchRequest()
try context.fetch(request)
UserDefaults.preferredPeripheralNum = Int(myInfo?.myNodeNum ?? 0)
connectTo(peripheral: peripheral)
Logger.data.notice("🗂️ Restored Core data for /\(UserDefaults.preferredPeripheralNum, privacy: .public)")

View file

@ -30,7 +30,8 @@ struct MessageText: View {
.background(isCurrentUser ? .accentColor : Color(.gray))
.cornerRadius(15)
.overlay {
if message.pkiEncrypted && message.ackError == 0 && message.realACK {
/// Show the lock if the message is pki encrypted and has a real ack if sent by the current user, or is pki encrypted for incoming messages
if message.pkiEncrypted && message.realACK || !isCurrentUser && message.pkiEncrypted {
VStack(alignment: .trailing) {
Spacer()
HStack {