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:
parent
a6285cc827
commit
b68853c53e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue