diff --git a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift index cfc213582..8b4acf3ae 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift @@ -219,9 +219,15 @@ extension MessageReceiver { // Note: We only update these values if the proto actually has values for them (this is to // prevent an edge case where an old client could override the values with default values // since they aren't included) - if contactInfo.hasIsApproved { contact.isApproved = contactInfo.isApproved } + // + // Note: Since message requests has no reverse, the only case we need to process is a + // config message setting *isApproved* and *didApproveMe* to true. This may prevent some + // weird edge cases where a config message swapping *isApproved* and *didApproveMe* to + // false. + if contactInfo.hasIsApproved && contactInfo.isApproved { contact.isApproved = true } + if contactInfo.hasDidApproveMe && contactInfo.didApproveMe { contact.didApproveMe = true } + if contactInfo.hasIsBlocked { contact.isBlocked = contactInfo.isBlocked } - if contactInfo.hasDidApproveMe { contact.didApproveMe = contactInfo.didApproveMe } Storage.shared.setContact(contact, using: transaction)