mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 16:25:21 +00:00
Implement handshake request notifications for pending messages (#321)
- Add handshakeRequest packet type (0x25) to notify recipients about queued messages - Create HandshakeRequest struct with binary encoding for efficient transmission - Send handshake requests when messages are queued due to missing session - Display notifications when someone wants to send messages - Fix verification persistence bug by adding forceSave on app termination - Update UI to handle optional encryption icons (hide when no handshake attempted) Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -13,15 +13,18 @@ import os.log
|
||||
// MARK: - Encryption Status
|
||||
|
||||
enum EncryptionStatus: Equatable {
|
||||
case none
|
||||
case noiseHandshaking
|
||||
case noiseSecured
|
||||
case noiseVerified
|
||||
case none // Failed or incompatible
|
||||
case noHandshake // No handshake attempted yet
|
||||
case noiseHandshaking // Currently establishing
|
||||
case noiseSecured // Established but not verified
|
||||
case noiseVerified // Established and verified
|
||||
|
||||
var icon: String {
|
||||
var icon: String? { // Made optional to hide icon when no handshake
|
||||
switch self {
|
||||
case .none:
|
||||
return "lock.slash"
|
||||
return "lock.slash" // Failed handshake
|
||||
case .noHandshake:
|
||||
return nil // No icon when no handshake attempted
|
||||
case .noiseHandshaking:
|
||||
return "lock.rotation"
|
||||
case .noiseSecured:
|
||||
@@ -34,6 +37,8 @@ enum EncryptionStatus: Equatable {
|
||||
var description: String {
|
||||
switch self {
|
||||
case .none:
|
||||
return "Encryption failed"
|
||||
case .noHandshake:
|
||||
return "Not encrypted"
|
||||
case .noiseHandshaking:
|
||||
return "Establishing encryption..."
|
||||
|
||||
Reference in New Issue
Block a user