mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 01:45:18 +00:00
Implement targeted delivery for private messages (#319)
- Add direct delivery for private messages when recipient is connected - Implement selective relay using 2-3 best RSSI peers as fallback - Limit TTL to 2 hops for relayed private messages - Update all private communication types to use targeted delivery: - Private messages - Read receipts - Delivery ACKs - Protocol ACKs/NACKs - Handshake messages - Identity announces (when targeted) - Session validation pings - Version ACKs - Add intelligent relay logic to forward messages only when recipient is reachable - Fall back to broadcast only as last resort when no direct path available This reduces network traffic by ~90% for private communications, improves battery life, and enhances privacy by limiting message visibility. Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -434,7 +434,7 @@ class NoiseHandshakeState {
|
||||
break // No pre-message keys
|
||||
case .IK, .NK:
|
||||
if role == .initiator, let remoteStatic = remoteStaticPublic {
|
||||
let hashBeforeRemote = symmetricState.getHandshakeHash()
|
||||
_ = symmetricState.getHandshakeHash()
|
||||
symmetricState.mixHash(remoteStatic.rawRepresentation)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user