mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
fix: empty set in appropriate places for current closed groups
This commit is contained in:
parent
a689e38f33
commit
5a7b67f3f5
@ -33,12 +33,13 @@ class MessageReceiveJob(val data: ByteArray, val serverHash: String? = null, val
|
||||
fun executeAsync(dispatcherName: String): Promise<Unit, Exception> {
|
||||
val deferred = deferred<Unit, Exception>()
|
||||
try {
|
||||
val isRetry: Boolean = failureCount != 0
|
||||
val storage = MessagingModuleConfiguration.shared.storage
|
||||
val serverPublicKey = openGroupID?.let {
|
||||
MessagingModuleConfiguration.shared.storage.getOpenGroupPublicKey(it.split(".").dropLast(1).joinToString("."))
|
||||
storage.getOpenGroupPublicKey(it.split(".").dropLast(1).joinToString("."))
|
||||
}
|
||||
val (message, proto) = MessageReceiver.parse(this.data, this.openGroupMessageServerID, openGroupPublicKey = serverPublicKey)
|
||||
val threadId = Message.getThreadId(message, this.openGroupID, MessagingModuleConfiguration.shared.storage, false)
|
||||
val currentClosedGroups = storage.getAllActiveClosedGroupPublicKeys()
|
||||
val (message, proto) = MessageReceiver.parse(this.data, this.openGroupMessageServerID, openGroupPublicKey = serverPublicKey, currentClosedGroups = currentClosedGroups)
|
||||
val threadId = Message.getThreadId(message, this.openGroupID, storage, false)
|
||||
message.serverHash = serverHash
|
||||
MessageReceiver.handle(message, proto, threadId ?: -1, this.openGroupID)
|
||||
this.handleSuccess(dispatcherName)
|
||||
|
@ -262,7 +262,8 @@ class OpenGroupPoller(private val server: String, private val executorService: S
|
||||
null,
|
||||
fromOutbox,
|
||||
if (fromOutbox) it.recipient else it.sender,
|
||||
serverPublicKey
|
||||
serverPublicKey,
|
||||
emptySet() // this shouldn't be necessary as we are polling open groups here
|
||||
)
|
||||
if (fromOutbox) {
|
||||
val mapping = mappingCache[it.recipient] ?: storage.getOrCreateBlindedIdMapping(
|
||||
|
@ -146,7 +146,10 @@ class Poller(private val configFactory: ConfigFactoryProtocol, debounceTimer: Ti
|
||||
var latestMessageTimestamp: Long? = null
|
||||
messages.forEach { (envelope, hash) ->
|
||||
try {
|
||||
val (message, _) = MessageReceiver.parse(data = envelope.toByteArray(), openGroupServerID = null)
|
||||
val (message, _) = MessageReceiver.parse(data = envelope.toByteArray(),
|
||||
// assume no groups in personal poller messages
|
||||
openGroupServerID = null, currentClosedGroups = emptySet()
|
||||
)
|
||||
// sanity checks
|
||||
if (message !is SharedConfigurationMessage) {
|
||||
Log.w("Loki", "shared config message handled in configs wasn't SharedConfigurationMessage but was ${message.javaClass.simpleName}")
|
||||
|
Loading…
Reference in New Issue
Block a user