fix(messenger_handler): fix group chat not being set as active (#3545)

Fixes an issue where if a group chat was first received from a non-contact, and later received from a contact, it still wouldn't save it as active.

That's because we checked if we were **newly** added instead of just if we were added. That meant that in the case I described above, the chat would then never have the chance to be set active.
This commit is contained in:
Jonathan Rainville 2023-05-30 09:49:46 -04:00 committed by GitHub
parent a6285cc827
commit b68853c53e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -1 +1 @@
0.152.3
0.152.4

View File

@ -158,11 +158,10 @@ func (m *Messenger) HandleMembershipUpdate(messageState *ReceivedMessageState, c
}
chat.updateChatFromGroupMembershipChanges(group)
wasUserAdded = !existingGroup.IsMember(ourKey) &&
group.IsMember(ourKey)
// Reactivate deleted group chat on re-invite from contact
chat.Active = chat.Active || (isActive && wasUserAdded)
chat.Active = chat.Active || (isActive && group.IsMember(ourKey))
wasUserAdded = !existingGroup.IsMember(ourKey) && group.IsMember(ourKey)
// Show push notifications when our key is added to members list and chat is Active
showPushNotification = showPushNotification && wasUserAdded