ios: show notifications for different users (#1874)

* ios: show notifications for different users

* refactore

* terminate background taks on chat item update

* refactor

* refactor2

* refactor3

* refactor 4

* refactor5

* fix chat item update in Android

---------

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
Stanislav Dmitrenko
2023-02-02 16:09:36 +00:00
committed by GitHub
parent c55a7692c5
commit bcca27bfdb
5 changed files with 51 additions and 50 deletions
@@ -1441,8 +1441,11 @@ open class ChatController(var ctrl: ChatCtrl?, val ntfManager: NtfManager, val a
private suspend fun chatItemSimpleUpdate(user: User, aChatItem: AChatItem) {
val cInfo = aChatItem.chatInfo
val cItem = aChatItem.chatItem
if (!active(user) || chatModel.upsertChatItem(cInfo, cItem)) {
ntfManager.notifyMessageReceived(chatModel.currentUser.value!!, cInfo, cItem)
val notify = { ntfManager.notifyMessageReceived(user, cInfo, cItem) }
if (!active(user)) {
notify()
} else if (chatModel.upsertChatItem(cInfo, cItem)) {
notify()
}
}