mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 08:25:21 +00:00
Fix compilation error and add peer tracking logs
- Remove reference to undefined wasInserted variable - Add proper logging after wasInserted is defined - Track when peers are added vs already present
This commit is contained in:
@@ -1978,7 +1978,7 @@ class BluetoothMeshService: NSObject {
|
|||||||
|
|
||||||
// Check if we've already announced this peer
|
// Check if we've already announced this peer
|
||||||
let isFirstAnnounce = !announcedPeers.contains(senderID)
|
let isFirstAnnounce = !announcedPeers.contains(senderID)
|
||||||
print("📱 Peer announce: \(senderID), isFirstAnnounce: \(isFirstAnnounce), wasInserted: \(wasInserted ?? false)")
|
print("📱 Peer announce: \(senderID), isFirstAnnounce: \(isFirstAnnounce)")
|
||||||
|
|
||||||
// Clean up stale peer IDs with the same nickname
|
// Clean up stale peer IDs with the same nickname
|
||||||
collectionsQueue.sync(flags: .barrier) {
|
collectionsQueue.sync(flags: .barrier) {
|
||||||
@@ -2103,7 +2103,9 @@ class BluetoothMeshService: NSObject {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
if wasInserted {
|
if wasInserted {
|
||||||
// Added peer \(senderID) (\(nickname)) to active peers
|
print("📱 Added peer \(senderID) (\(nickname)) to active peers")
|
||||||
|
} else {
|
||||||
|
print("📱 Peer \(senderID) already in active peers")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show join message only for first announce AND if we actually added the peer
|
// Show join message only for first announce AND if we actually added the peer
|
||||||
|
|||||||
Reference in New Issue
Block a user