Fix notification release issues (#925)

* fix: background polling issue for 1on1 messages, update the HomeDiffUtil.kt to include more cases to compare content equality, add synchronized ConversationNotificationDebouncer.kt and reduce the debouncer time

* fix: replace updateNotification to be thread-specific to fix unread behaviour and currently visible thread behaviour

* refactor: remove trimmed text limits
This commit is contained in:
Harris
2022-07-19 14:31:50 +10:00
committed by GitHub
parent ba60e8a8ee
commit 344e7f333e
5 changed files with 26 additions and 22 deletions

View File

@@ -128,19 +128,21 @@ class BatchMessageReceiveJob(
}
// increment unreads, notify, and update thread
val unreadFromMine = messageIds.indexOfLast { (_,fromMe) -> fromMe }
var trueUnreadCount = messageIds.size
var trueUnreadCount = messageIds.filter { (_,fromMe) -> !fromMe }.size
if (unreadFromMine >= 0) {
trueUnreadCount -= (unreadFromMine + 1)
storage.markConversationAsRead(threadId, false)
}
storage.incrementUnread(threadId, trueUnreadCount)
if (trueUnreadCount > 0) {
storage.incrementUnread(threadId, trueUnreadCount)
}
storage.updateThread(threadId, true)
SSKEnvironment.shared.notificationManager.updateNotification(context, threadId)
}
}
// await all thread processing
deferredThreadMap.awaitAll()
}
SSKEnvironment.shared.notificationManager.updateNotification(context)
if (failures.isEmpty()) {
handleSuccess()
} else {