Skip to content

Commit ea51c92

Browse files
Copilotgarthvh
andauthored
Resolve merge conflicts with main, re-apply measurement fixes to refactored NodeDetail
Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
2 parents 0de7c7c + cb62400 commit ea51c92

56 files changed

Lines changed: 994 additions & 796 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Meshtastic/CarPlay/CarPlaySceneDelegate.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,13 @@ class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate, CPI
182182

183183
private func fetchFavoriteContactItems() -> [CPMessageListItem] {
184184
do {
185-
let descriptor = FetchDescriptor<NodeInfoEntity>(
185+
let activeNum = Int64(AccessoryManager.shared.activeDeviceNum ?? 0)
186+
var descriptor = FetchDescriptor<NodeInfoEntity>(
187+
predicate: #Predicate<NodeInfoEntity> { $0.favorite == true && $0.num != activeNum },
186188
sortBy: [SortDescriptor(\.lastHeard, order: .reverse)]
187189
)
188-
let activeNum = AccessoryManager.shared.activeDeviceNum ?? 0
189-
let nodes = try context.fetch(descriptor).filter { $0.favorite && $0.num != activeNum }
190+
descriptor.fetchLimit = 50
191+
let nodes = try context.fetch(descriptor)
190192
let nodeNums = nodes.compactMap { $0.user != nil ? $0.num : nil as Int64? }
191193
let unreadCounts = fetchUnreadCountsForDMs(nodeNums: nodeNums)
192194
let now = Date()

Meshtastic/Helpers/TAK/CoTMessage.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,17 @@ struct CoTMessage: Identifiable, Sendable {
282282
// MARK: - XML Generation
283283

284284
/// Generate CoT XML string for transmission to TAK clients
285+
private static let xmlDateFormatStyle = Date.ISO8601FormatStyle(includingFractionalSeconds: true, timeZone: TimeZone(secondsFromGMT: 0)!)
286+
285287
func toXML() -> String {
286-
let dateFormatter = ISO8601DateFormatter()
287-
dateFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
288+
let dateFormatter = Self.xmlDateFormatStyle
288289

289290
var cot = "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>"
290291
cot += "<event version='2.0' uid='\(uid.xmlEscaped)' "
291292
cot += "type='\(type)' "
292-
cot += "time='\(dateFormatter.string(from: time))' "
293-
cot += "start='\(dateFormatter.string(from: start))' "
294-
cot += "stale='\(dateFormatter.string(from: stale))' "
293+
cot += "time='\(time.formatted(dateFormatter))' "
294+
cot += "start='\(start.formatted(dateFormatter))' "
295+
cot += "stale='\(stale.formatted(dateFormatter))' "
295296
cot += "how='\(how)'>"
296297
cot += "<point lat='\(latitude)' lon='\(longitude)' "
297298
cot += "hae='\(hae)' ce='\(ce)' le='\(le)'/>"
@@ -352,7 +353,7 @@ struct CoTMessage: Identifiable, Sendable {
352353
cot += "<__serverdestination destinations='0.0.0.0:4242:tcp:\(senderUid.xmlEscaped)'/>"
353354
cot += "<remarks source='BAO.F.ATAK.\(senderUid.xmlEscaped)' "
354355
cot += "to='\(chat.chatroom.xmlEscaped)' "
355-
cot += "time='\(dateFormatter.string(from: time))'>"
356+
cot += "time='\(time.formatted(dateFormatter))'>"
356357
cot += "\(chat.message.xmlEscaped)</remarks>"
357358
} else if let remarks, !remarks.isEmpty {
358359
cot += "<remarks>\(remarks.xmlEscaped)</remarks>"
290 KB
Loading
17.3 KB
Loading
220 KB
Loading
-152 KB
Binary file not shown.
Binary file not shown.
316 KB
Loading
534 KB
Loading
26.1 KB
Loading

0 commit comments

Comments
 (0)