Fix approval not saved to user config

This commit is contained in:
Andrew 2024-05-06 15:41:07 +09:30
parent 7832f13562
commit b92c4065cc

View File

@ -1491,14 +1491,8 @@ open class Storage(
val address = recipient.address.serialize()
val blindedId = when {
recipient.isGroupRecipient -> null
recipient.isOpenGroupInboxRecipient -> {
GroupUtil.getDecodedOpenGroupInboxSessionId(address)
}
else -> {
if (SessionId(address).prefix == IdPrefix.BLINDED) {
address
} else null
}
recipient.isOpenGroupInboxRecipient -> GroupUtil.getDecodedOpenGroupInboxSessionId(address)
else -> address.takeIf { SessionId(it).prefix == IdPrefix.BLINDED }
} ?: continue
mappingDb.getBlindedIdMapping(blindedId).firstOrNull()?.let {
mappings[address] = it
@ -1516,8 +1510,8 @@ open class Storage(
smsDb.updateThreadId(blindedThreadId, threadId)
threadDB.deleteConversation(blindedThreadId)
}
recipientDb.setApproved(sender, true)
recipientDb.setApprovedMe(sender, true)
setRecipientApproved(sender, true)
setRecipientApprovedMe(sender, true)
val message = IncomingMediaMessage(
sender.address,
response.sentTimestamp!!,