diff --git a/ts/groups.ts b/ts/groups.ts index 3c6e8007a8..d30b07f295 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -1259,7 +1259,23 @@ function extractDiffs({ // Here we hardcode initial messages if this is our first time processing data this // group. Ideally we can collapse it down to just one of: 'you were added', // 'you were invited', or 'you created.' - if (firstUpdate && dropInitialJoinMessage) { + if (firstUpdate && ourConversationId && areWeInvitedToGroup) { + // Note, we will add 'you were invited' to group even if dropInitialJoinMessage = true + message = { + ...generateBasicMessage(), + type: 'group-v2-change', + groupV2Change: { + from: whoInvitedUsUserId || sourceConversationId, + details: [ + { + type: 'pending-add-one', + conversationId: ourConversationId, + }, + ], + }, + }; + } else if (firstUpdate && dropInitialJoinMessage) { + // None of the rest of the messages should be added if dropInitialJoinMessage = true message = undefined; } else if ( firstUpdate && @@ -1279,20 +1295,6 @@ function extractDiffs({ ], }, }; - } else if (firstUpdate && ourConversationId && areWeInvitedToGroup) { - message = { - ...generateBasicMessage(), - type: 'group-v2-change', - groupV2Change: { - from: whoInvitedUsUserId || sourceConversationId, - details: [ - { - type: 'pending-add-one', - conversationId: ourConversationId, - }, - ], - }, - }; } else if (firstUpdate && ourConversationId && areWeInGroup) { message = { ...generateBasicMessage(),