ios: do not show notifications on update events in inactive profiles (#1959)

This commit is contained in:
Evgeny Poberezkin
2023-02-27 16:20:54 +00:00
committed by GitHub
parent d5f6b76ec5
commit f6f3d17383

View File

@@ -1270,11 +1270,8 @@ func chatItemSimpleUpdate(_ user: User, _ aChatItem: AChatItem) {
let m = ChatModel.shared
let cInfo = aChatItem.chatInfo
let cItem = aChatItem.chatItem
let notify = { NtfManager.shared.notifyMessageReceived(user, cInfo, cItem) }
if !active(user) {
notify()
} else if m.upsertChatItem(cInfo, cItem) {
notify()
if active(user) && m.upsertChatItem(cInfo, cItem) {
NtfManager.shared.notifyMessageReceived(user, cInfo, cItem)
}
}