refactor: execute the sync before inviting, update libsession module
This commit is contained in:
parent
d162522ac2
commit
25caf9b893
|
@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.database
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
import network.loki.messenger.libsession_util.Config
|
import network.loki.messenger.libsession_util.Config
|
||||||
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_HIDDEN
|
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_HIDDEN
|
||||||
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_PINNED
|
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_PINNED
|
||||||
|
@ -1326,10 +1327,22 @@ open class Storage(
|
||||||
|
|
||||||
val destination = Destination.ClosedGroup(groupSessionId)
|
val destination = Destination.ClosedGroup(groupSessionId)
|
||||||
|
|
||||||
ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(destination)
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response.get()
|
response.get()
|
||||||
|
|
||||||
|
val newConfigSync = ConfigurationSyncJob(destination)
|
||||||
|
runBlocking {
|
||||||
|
newConfigSync.execute("updating-members")
|
||||||
|
}
|
||||||
|
|
||||||
|
configFactory.saveGroupConfigs(keysConfig, infoConfig, membersConfig)
|
||||||
|
|
||||||
|
val job = InviteContactsJob(groupSessionId, filteredMembers.toTypedArray())
|
||||||
|
JobQueue.shared.add(job)
|
||||||
|
|
||||||
|
infoConfig.free()
|
||||||
|
membersConfig.free()
|
||||||
|
keysConfig.free()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("ClosedGroup", "Failed to store new key", e)
|
Log.e("ClosedGroup", "Failed to store new key", e)
|
||||||
infoConfig.free()
|
infoConfig.free()
|
||||||
|
@ -1339,17 +1352,6 @@ open class Storage(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
configFactory.saveGroupConfigs(keysConfig, infoConfig, membersConfig)
|
|
||||||
|
|
||||||
infoConfig.free()
|
|
||||||
membersConfig.free()
|
|
||||||
keysConfig.free()
|
|
||||||
|
|
||||||
val newConfigSync = ConfigurationSyncJob(destination)
|
|
||||||
JobQueue.shared.add(newConfigSync)
|
|
||||||
|
|
||||||
val job = InviteContactsJob(groupSessionId, filteredMembers.toTypedArray())
|
|
||||||
JobQueue.shared.add(job)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setServerCapabilities(server: String, capabilities: List<String>) {
|
override fun setServerCapabilities(server: String, capabilities: List<String>) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 50f0cde43bccd5e8b790997e8b72a868ba3f9568
|
Subproject commit c52f689c823ec57255ed38301c8b7d6eca180a6c
|
Loading…
Reference in New Issue