improve identity announcements (#198)

* improve identity announcements

* touches

* signing noise id

* panic mode delete signing key
This commit is contained in:
callebtc
2025-07-31 06:26:41 +02:00
committed by GitHub
parent 34d00839b2
commit 4cb5932fd0
15 changed files with 302 additions and 113 deletions
@@ -41,13 +41,23 @@ class BluetoothConnectionManager(
// Delegate for component managers to call back to main manager
private val componentDelegate = object : BluetoothConnectionManagerDelegate {
override fun onPacketReceived(packet: BitchatPacket, peerID: String, device: BluetoothDevice?) {
Log.d(TAG, "onPacketReceived: Packet received from ${device?.address} ($peerID)")
device?.let { bluetoothDevice ->
// if connection does not have a peerID yet, we assume that the first package
// we receive from that connection is from the peer
if (!connectionTracker.addressPeerMap.containsKey(device.address)) {
Log.d(TAG, "First packet received from new device: ${bluetoothDevice.address}, assuming peerID: $peerID")
connectionTracker.addressPeerMap[device.address] = peerID
}
// Get current RSSI for this device and update if available
val currentRSSI = connectionTracker.getBestRSSI(bluetoothDevice.address)
if (currentRSSI != null) {
delegate?.onRSSIUpdated(bluetoothDevice.address, currentRSSI)
}
}
if (peerID == myPeerID) return // Ignore messages from self
delegate?.onPacketReceived(packet, peerID, device)
}