mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 21:05:20 +00:00
Fix peer nickname display once and for all
- Only show peers in UI who have announced (have nicknames) - Filter out peers without nicknames from getAllConnectedPeerIDs() - Send announces proactively when app starts, not just on connection - Send announces immediately when nickname changes via saveNickname() - Send announces when Bluetooth services become available - Send announces multiple times (0.5s, 1s, 2s) for reliability - Add sendBroadcastAnnounce() method for proactive announcing This ensures peers always see proper nicknames, never 'person-xxx'
This commit is contained in:
@@ -61,6 +61,9 @@ class ChatViewModel: ObservableObject {
|
||||
func saveNickname() {
|
||||
userDefaults.set(nickname, forKey: nicknameKey)
|
||||
userDefaults.synchronize() // Force immediate save
|
||||
|
||||
// Send announce with new nickname to all peers
|
||||
meshService.sendBroadcastAnnounce()
|
||||
}
|
||||
|
||||
private func loadFavorites() {
|
||||
|
||||
Reference in New Issue
Block a user