Add block/unblock user commands

Implemented user blocking functionality:
- /block <nickname> - blocks a user from private messaging and ignores their messages in channels
- /block - lists all blocked users
- /unblock <nickname> - unblocks a user

Implementation details:
- Blocks are stored by public key fingerprint for persistence across sessions
- Blocked users cannot send private messages or have their public messages displayed
- Blocked users are silently ignored (they don't know they're blocked)
- Blocking a user automatically removes them from favorites
- Added getPeerPublicKey() method to BluetoothMeshService for accessing peer identity keys
This commit is contained in:
jack
2025-07-08 02:36:23 +02:00
parent ccf0ba2ef2
commit e0ce234d08
2 changed files with 242 additions and 0 deletions
@@ -249,6 +249,11 @@ class BluetoothMeshService: NSObject {
return String(fingerprint)
}
// Public method to get peer's public key data
func getPeerPublicKey(_ peerID: String) -> Data? {
return encryptionService.getPeerIdentityKey(peerID)
}
override init() {
// Generate ephemeral peer ID for each session to prevent tracking
// Use random bytes instead of UUID for better anonymity