From b919b3ff0ac549e0a9d7856dbaab85eb58d9232c Mon Sep 17 00:00:00 2001 From: jack Date: Tue, 26 Aug 2025 13:21:13 +0200 Subject: [PATCH] UI: unread envelope uses orange; hasUnreadMessages checks Nostr conv key for peers with known Nostr pubkeys (geohash DM consistency) --- bitchat/ViewModels/ChatViewModel.swift | 7 +++++++ bitchat/Views/MeshPeerList.swift | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bitchat/ViewModels/ChatViewModel.swift b/bitchat/ViewModels/ChatViewModel.swift index 608ed861..860b5125 100644 --- a/bitchat/ViewModels/ChatViewModel.swift +++ b/bitchat/ViewModels/ChatViewModel.swift @@ -935,6 +935,13 @@ class ChatViewModel: ObservableObject, BitchatDelegate { if unreadPrivateMessages.contains(noiseKeyHex) { return true } + // Also check for geohash (Nostr) DM conv key if this peer has a known Nostr pubkey + if let nostrHex = peer.nostrPublicKey { + let convKey = "nostr_" + String(nostrHex.prefix(TransportConfig.nostrConvKeyPrefixLength)) + if unreadPrivateMessages.contains(convKey) { + return true + } + } } // Get the peer's nickname to check for temporary Nostr peer IDs diff --git a/bitchat/Views/MeshPeerList.swift b/bitchat/Views/MeshPeerList.swift index df25f8af..8e03b8ec 100644 --- a/bitchat/Views/MeshPeerList.swift +++ b/bitchat/Views/MeshPeerList.swift @@ -119,7 +119,7 @@ struct MeshPeerList: View { if !isMe, item.hasUnread { Image(systemName: "envelope.fill") .font(.system(size: 10)) - .foregroundColor(.yellow) + .foregroundColor(.orange) .help("New messages") }