From b9e99fbe0e5252a8bf5293ffce14919a053b6f98 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 25 Feb 2025 07:02:10 -0800 Subject: [PATCH] Add Core portnums, reduce MQTT password size --- Localizable.xcstrings | 1 + Meshtastic/Enums/DeviceEnums.swift | 7 +++++++ Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift | 3 +-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Localizable.xcstrings b/Localizable.xcstrings index e061cceb..d1ce81ed 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -9171,6 +9171,7 @@ } }, "Empty" : { + "extractionState" : "stale", "localizations" : { "sr" : { "stringUnit" : { diff --git a/Meshtastic/Enums/DeviceEnums.swift b/Meshtastic/Enums/DeviceEnums.swift index 3f76054f..4e0bdf27 100644 --- a/Meshtastic/Enums/DeviceEnums.swift +++ b/Meshtastic/Enums/DeviceEnums.swift @@ -144,6 +144,7 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable { case allSkipDecoding = 1 case localOnly = 2 case knownOnly = 3 + case corePortnums = 4 var id: Int { self.rawValue } @@ -157,6 +158,8 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable { return "Local Only" case .knownOnly: return "Known Only" + case .corePortnums: + return "Core Portnums Only" } } var description: String { @@ -169,6 +172,8 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable { return "Ignores observed messages from foreign meshes that are open or those which it cannot decrypt. Only rebroadcasts message on the nodes local primary / secondary channels." case .knownOnly: return "Ignores observed messages from foreign meshes like Local Only, but takes it step further by also ignoring messages from nodes not already in the node's known list." + case .corePortnums: + return "Only rebroadcasts packets from the core portnums: NodeInfo, Text, Position, Telemetry, and Routing." } } func protoEnumValue() -> Config.DeviceConfig.RebroadcastMode { @@ -182,6 +187,8 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable { return Config.DeviceConfig.RebroadcastMode.localOnly case .knownOnly: return Config.DeviceConfig.RebroadcastMode.knownOnly + case .corePortnums: + return Config.DeviceConfig.RebroadcastMode.corePortnumsOnly } } } diff --git a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift index d840d1e1..5114a7e4 100644 --- a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift @@ -196,7 +196,6 @@ struct MQTTConfig: View { } .keyboardType(.default) .scrollDismissesKeyboard(.interactively) - HStack { Label("password", systemImage: "wallet.pass") TextField("password", text: $password) @@ -206,7 +205,7 @@ struct MQTTConfig: View { .onChange(of: password) { var totalBytes = password.utf8.count // Only mess with the value if it is too big - while totalBytes > 62 { + while totalBytes > 30 { password = String(password.dropLast()) totalBytes = password.utf8.count }