send tr received notification

This commit is contained in:
Matthew Davies 2025-01-26 11:32:45 -08:00
parent 4a7f5a261f
commit 489ca28529
No known key found for this signature in database
GPG key ID: 4B0314C2EFD91AC7

View file

@ -960,6 +960,22 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
}
traceRoute?.hops = NSOrderedSet(array: hopNodes)
traceRoute?.time = Date()
if let tr = traceRoute {
let manager = LocalNotificationManager()
manager.notifications = [
Notification(
id: (UUID().uuidString),
title: "Traceroute Complete",
subtitle: "TR received back from \(destinationHop.name ?? "unknown")",
content: "Hops from: \(tr.hopsTowards), Hops back: \(tr.hopsBack)\n\(tr.routeText ?? "unknown".localized)\n\(tr.routeBackText ?? "unknown".localized)",
target: "nodes",
path: "meshtastic:///nodes?nodenum=\(connectedNode.user?.num ?? 0)"
)
]
manager.schedule()
}
do {
try context.save()
Logger.data.info("💾 Saved Trace Route")