From ce968cc5f8c378646e2ec7cb775b588cd9d48bc5 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Thu, 10 Oct 2024 13:30:09 +1100 Subject: [PATCH] Only force a contact to visible if the approval goes from 'not approved' to 'approved' --- .../main/java/org/thoughtcrime/securesms/database/Storage.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 d7ad48b497..28794e8ce6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -1582,8 +1582,11 @@ open class Storage( DatabaseComponent.get(context).recipientDatabase().setApproved(recipient, approved) if (recipient.isLocalNumber || !recipient.isContactRecipient) return configFactory.contacts?.upsertContact(recipient.address.serialize()) { + // if the contact wasn't approved before but is approved now, make sure it's visible + if(approved && !this.approved) this.priority = PRIORITY_VISIBLE + + // update approval this.approved = approved - this.priority = PRIORITY_VISIBLE } }