From b92c4065cc5670e8dbc5d53d85072dff8011eb58 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 6 May 2024 15:41:07 +0930 Subject: [PATCH] Fix approval not saved to user config --- .../org/thoughtcrime/securesms/database/Storage.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt index 354ec05c46..3ebcbf6d2b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -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!!,