updateGroup: Use hasMember instead of 'left' attribute for membership

This commit is contained in:
Scott Nonnenberg 2021-10-20 14:32:38 -07:00 committed by GitHub
parent b32d068e83
commit fe49edce8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -2785,6 +2785,7 @@ async function updateGroup(
{ viaSync = false } = {}
): Promise<void> {
const { newAttributes, groupChangeMessages, members } = updates;
const ourUuid = window.textsecure.storage.user.getCheckedUuid();
const startingRevision = conversation.get('revision');
const endingRevision = newAttributes.revision;
@ -2792,7 +2793,8 @@ async function updateGroup(
const isInitialDataFetch =
!isNumber(startingRevision) && isNumber(endingRevision);
const isInGroup = !updates.newAttributes.left;
const justJoinedGroup = conversation.get('left') && isInGroup;
const justJoinedGroup =
!conversation.hasMember(ourUuid.toString()) && isInGroup;
// Ensure that all generated messages are ordered properly.
// Before the provided timestamp so update messages appear before the

View File

@ -2211,6 +2211,7 @@ export function initialize({
timeout: 0,
type: 'GET',
version,
redactUrl: _createRedactor(key),
});
}