Skip to content

Commit

Permalink
updateGroup: Use hasMember instead of 'left' attribute for membership
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Nonnenberg <scott@signal.org>
  • Loading branch information
automated-signal and scottnonnenberg-signal committed Oct 20, 2021
1 parent a551170 commit a707c2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ts/groups.ts
Expand Up @@ -2785,14 +2785,16 @@ 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;

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
Expand Down
1 change: 1 addition & 0 deletions ts/textsecure/WebAPI.ts
Expand Up @@ -2211,6 +2211,7 @@ export function initialize({
timeout: 0,
type: 'GET',
version,
redactUrl: _createRedactor(key),
});
}

Expand Down

0 comments on commit a707c2b

Please sign in to comment.