wip: maybe the volatile is being updated with 0 on batch message receive?

This commit is contained in:
0x330a 2023-06-27 19:00:10 +10:00
parent a15842166c
commit df39194024
2 changed files with 4 additions and 1 deletions

View File

@ -496,6 +496,8 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
private fun updateConvoVolatile(convos: ConversationVolatileConfig) {
val extracted = convos.all()
Log.d("Loki-DBG", "All conversations")
Log.d("Loki-DBG", convos.allCommunities().joinToString("\n"))
for (conversation in extracted) {
val threadId = when (conversation) {
is Conversation.OneToOne -> getThreadIdFor(conversation.sessionId, null, null, createThread = false)
@ -1046,6 +1048,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
markConversationAsRead(threadId, volatile.lastRead, force = true)
Log.d("Loki-DBG", "set latest volatile read for $room to ${volatile.lastRead}")
}
volatileConfig.set(volatile)
}
override fun hasBackgroundGroupAddJob(groupJoinUrl: String): Boolean {

View File

@ -229,7 +229,7 @@ class BatchMessageReceiveJob(
if (!openGroupID.isNullOrEmpty()) {
Log.d("Loki-DBG", "new-lastSeen for: $openGroupID is $currentLastSeen")
}
storage.markConversationAsRead(threadId, newLastSeen)
storage.markConversationAsRead(threadId, newLastSeen, force = true)
storage.updateThread(threadId, true)
SSKEnvironment.shared.notificationManager.updateNotification(context, threadId)
}