Implement proper room leave notifications and improve UI

- Send leave notifications when users exit rooms
- Update room member lists when peers leave rooms
- Change current user icon from dot to person.fill
- Handle room-specific leave messages via protocol
- Maintain backwards compatibility for general peer disconnection
This commit is contained in:
jack
2025-07-05 19:35:37 +02:00
parent cdb93543ba
commit 4dec23e216
4 changed files with 79 additions and 23 deletions
+5
View File
@@ -155,6 +155,7 @@ protocol BitchatDelegate: AnyObject {
func didConnectToPeer(_ peerID: String)
func didDisconnectFromPeer(_ peerID: String)
func didUpdatePeerList(_ peers: [String])
func didReceiveRoomLeave(_ room: String, from peerID: String)
// Optional method to check if a fingerprint belongs to a favorite peer
func isFavorite(fingerprint: String) -> Bool
@@ -165,4 +166,8 @@ extension BitchatDelegate {
func isFavorite(fingerprint: String) -> Bool {
return false
}
func didReceiveRoomLeave(_ room: String, from peerID: String) {
// Default empty implementation
}
}