From f80c477d2bb42c3cd581e38ff3d1532ec5553382 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 20 May 2025 11:30:53 -0500 Subject: [PATCH] upsertNodeInfoPacket for contacts --- Meshtastic/Helpers/BLEManager.swift | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index cb759ffb..d769393d 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -1799,9 +1799,26 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate guard let binaryData: Data = try? toRadio.serializedData() else { return false } + + // Create a NodeInfo (User) packet for the newly added contact + var dataNodeMessage = DataMessage() + if let nodeInfoData = try? contact.user.serializedData() { + dataNodeMessage.payload = nodeInfoData + dataNodeMessage.portnum = PortNum.nodeinfoApp + + var nodeMeshPacket = MeshPacket() + nodeMeshPacket.id = UInt32.random(in: UInt32(UInt8.max)..