Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dm lock indicator #944

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,6 @@
},
": %d" : {

},
".dot" : {

},
".gauge" : {

},
".gradient" : {

},
".pill" : {

},
".text" : {

},
"(Re)define PIN_GPS_EN for your board." : {

Expand Down Expand Up @@ -19139,6 +19124,9 @@
},
"Send" : {

},
"Send ${messageContent} to ${channelNumber}" : {

},
"Send a Group Message" : {

Expand Down
8 changes: 4 additions & 4 deletions Meshtastic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down
17 changes: 14 additions & 3 deletions Meshtastic/Helpers/BLEManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)")
Expand Down
3 changes: 2 additions & 1 deletion Meshtastic/Views/Messages/MessageText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading