mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-29 08:29:22 +00:00
Revert "Remove duplicate retryPendingReadReceiptsIfViewing redeclaration on ChatViewModel (#1950)" (#1956)
This reverts commit 9e00139146.
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
1 parent
9e00139146
commit
1240953c26
1 file changed
+10
-2
@@ -98,8 +98,7 @@ extension ChatViewModel: ChatTransportEventContext {
|
||||
// `unreadPrivateMessages`, `selectedPrivateChatPeer`, `notifyUIChanged()`,
|
||||
// the inbound message handlers, `isPeerBlocked(_:)`,
|
||||
// `parseMentions(from:)`, `resolveNickname(for:)`,
|
||||
// `cacheStablePeerID(_:for:)`, `cachedStablePeerID(for:)`, and
|
||||
// `retryPendingReadReceiptsIfViewing(peerIDAliases:)` are shared
|
||||
// `cacheStablePeerID(_:for:)`, and `cachedStablePeerID(for:)` are shared
|
||||
// requirements with the other contexts or satisfied by existing
|
||||
// `ChatViewModel` members. The single-writer intent op
|
||||
// `unmarkReadReceiptsSent(_:)` lives next to its backing state in
|
||||
@@ -122,6 +121,15 @@ extension ChatViewModel: ChatTransportEventContext {
|
||||
messageRouter.failOverOutbox(for: peerIDAliases, excluding: meshService)
|
||||
}
|
||||
|
||||
func retryPendingReadReceiptsIfViewing(peerIDAliases: [PeerID]) {
|
||||
guard isAppActive, let selected = selectedPrivateChatPeer else { return }
|
||||
let aliasSet = Set(peerIDAliases)
|
||||
let shortAliases = Set(peerIDAliases.map { $0.toShort() })
|
||||
if aliasSet.contains(selected) || shortAliases.contains(selected.toShort()) {
|
||||
markPrivateMessagesAsRead(from: selected)
|
||||
}
|
||||
}
|
||||
|
||||
func retryCourierDeposits(via peerID: PeerID) {
|
||||
messageRouter.courierBecameAvailable(peerID)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user