mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 19:07:40 +00:00
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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user