throttle, update unread

This commit is contained in:
Evgeny Poberezkin
2024-08-01 20:58:19 +01:00
parent cf6e608384
commit 31ebfb03fa
4 changed files with 69 additions and 62 deletions

View File

@@ -1711,7 +1711,7 @@ func processReceivedMsg(_ res: ChatResponse) async {
let cItem = aChatItem.chatItem
await MainActor.run {
if active(user) {
NewItemThrottler.shared.receive(cItem, for: cInfo)
m.addChatItem(cInfo, cItem)
} else if cItem.isRcvNew && cInfo.ntfsEnabled {
m.increaseUnreadCounter(user: user)
}