fix: fix the notifications and request at appropriate time

This commit is contained in:
0x330a
2023-06-22 11:01:29 +10:00
parent 461669b7c2
commit 64fa5e297c
7 changed files with 21 additions and 35 deletions

View File

@@ -212,6 +212,7 @@ class BatchMessageReceiveJob(
}
}
}
if (threadId == NO_THREAD_MAPPING) return@async
// increment unreads, notify, and update thread
// last seen will be the current last seen if not changed (re-computes the read counts for thread record)
// might have been updated from a different thread at this point

View File

@@ -2,7 +2,6 @@ package org.session.libsession.messaging.jobs
import network.loki.messenger.libsession_util.ConfigBase
import network.loki.messenger.libsession_util.ConfigBase.Companion.protoKindFor
import network.loki.messenger.libsession_util.UserGroupsConfig
import nl.komponents.kovenant.functional.bind
import org.session.libsession.messaging.MessagingModuleConfiguration
import org.session.libsession.messaging.messages.Destination
@@ -109,7 +108,7 @@ data class ConfigurationSyncJob(val destination: Destination): Job {
@Suppress("UNCHECKED_CAST")
val responseList = (rawResponses["results"] as List<RawResponse>)
// we are always adding in deletions at the end
val deletionResponse = if (toDeleteRequest != null) responseList.last() else null
val deletionResponse = if (toDeleteRequest != null && responseList.isNotEmpty()) responseList.last() else null
val deletedHashes = deletionResponse?.let {
@Suppress("UNCHECKED_CAST")
// get the sub-request body