ios: add throttling for incoming messages

This commit is contained in:
Levitating Pineapple
2024-08-01 18:41:07 +03:00
parent bfab2d9fb6
commit e9797da238
3 changed files with 46 additions and 1 deletions
+1 -1
View File
@@ -1711,7 +1711,7 @@ func processReceivedMsg(_ res: ChatResponse) async {
let cItem = aChatItem.chatItem
await MainActor.run {
if active(user) {
m.addChatItem(cInfo, cItem)
NewItemThrottler.shared.receive(cItem, for: cInfo)
} else if cItem.isRcvNew && cInfo.ntfsEnabled {
m.increaseUnreadCounter(user: user)
}