mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:05:19 +00:00
Fix: use persisted read receipts during consolidation
Pass the UserDefaults-backed sentReadReceipts from ChatViewModel to consolidateMessages() to correctly identify already-read messages after app restart. This prevents duplicate read receipts and incorrect unread badges when reopening a chat shortly after reading it. Addresses PR review feedback.
This commit is contained in:
@@ -2560,7 +2560,8 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv
|
||||
}
|
||||
|
||||
// Consolidate messages from different peer ID representations (stable Noise key, temp Nostr IDs)
|
||||
_ = privateChatManager.consolidateMessages(for: peerID, peerNickname: peerNickname)
|
||||
// Pass persisted sentReadReceipts to correctly identify already-read messages after app restart
|
||||
_ = privateChatManager.consolidateMessages(for: peerID, peerNickname: peerNickname, persistedReadReceipts: sentReadReceipts)
|
||||
|
||||
// Trigger handshake if needed (mesh peers only). Skip for Nostr geohash conv keys.
|
||||
if !peerID.isGeoDM && !peerID.isGeoChat {
|
||||
|
||||
Reference in New Issue
Block a user