mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 21:05:20 +00:00
UI: unread envelope uses orange; hasUnreadMessages checks Nostr conv key for peers with known Nostr pubkeys (geohash DM consistency)
This commit is contained in:
@@ -935,6 +935,13 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
|||||||
if unreadPrivateMessages.contains(noiseKeyHex) {
|
if unreadPrivateMessages.contains(noiseKeyHex) {
|
||||||
return true
|
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
|
// Get the peer's nickname to check for temporary Nostr peer IDs
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ struct MeshPeerList: View {
|
|||||||
if !isMe, item.hasUnread {
|
if !isMe, item.hasUnread {
|
||||||
Image(systemName: "envelope.fill")
|
Image(systemName: "envelope.fill")
|
||||||
.font(.system(size: 10))
|
.font(.system(size: 10))
|
||||||
.foregroundColor(.yellow)
|
.foregroundColor(.orange)
|
||||||
.help("New messages")
|
.help("New messages")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user