From fe49edce8a74cf8083e1d9ca2a668a6262370381 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 20 Oct 2021 14:32:38 -0700 Subject: [PATCH] updateGroup: Use hasMember instead of 'left' attribute for membership --- ts/groups.ts | 4 +++- ts/textsecure/WebAPI.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/groups.ts b/ts/groups.ts index 43b7310d1..8278980cb 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -2785,6 +2785,7 @@ async function updateGroup( { viaSync = false } = {} ): Promise { 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 diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index 4b01644f6..08b012832 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -2211,6 +2211,7 @@ export function initialize({ timeout: 0, type: 'GET', version, + redactUrl: _createRedactor(key), }); }