Merge pull request #609 from RyanRory/fix-message-requests-reverse

Fix approved chats back to message requests inbox
pull/608/head
RyanZhao 2 years ago committed by GitHub
commit b281ea528a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save