Fixed SES-2802

Only force the priority to visible when going from not approved to approved
pull/1685/head
ThomasSession 6 months ago
parent eea61da38d
commit a01efc1fbc

@ -1589,8 +1589,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
}
}

@ -244,8 +244,7 @@ class DefaultConversationRepository @Inject constructor(
threadId: Long,
messages: Set<MessageRecord>
) {
val community = lokiThreadDb.getOpenGroupChat(threadId) ?:
throw Exception("Not a Community")
val community = checkNotNull(lokiThreadDb.getOpenGroupChat(threadId)) { "Not a community" }
messages.forEach { message ->
lokiMessageDb.getServerID(message.id, !message.isMms)?.let { messageServerID ->

Loading…
Cancel
Save