shouldOnlyAddUpdateMessage: boolean// set this to true to not apply the change to the convo itself, just add the update in the conversation
shouldOnlyAddUpdateMessage: boolean,// set this to true to not apply the change to the convo itself, just add the update in the conversation
expireUpdate: DisappearingMessageUpdate|null
){
// Check that the admin wasn't removed
constcurrentMembers=convo.get('members');
@ -745,12 +771,13 @@ async function handleClosedGroupMembersRemoved(
constgroupDiff: ClosedGroup.GroupDiff={
kickedMembers: effectivelyRemovedMembers,
};
awaitClosedGroup.addUpdateMessage(
awaitClosedGroup.addUpdateMessage({
convo,
groupDiff,
envelope.senderIdentity,
toNumber(envelope.timestamp)
);
diff: groupDiff,
sender: envelope.senderIdentity,
sentAt: toNumber(envelope.timestamp),
expireUpdate,
});
convo.updateLastMessage();
}
@ -833,7 +860,8 @@ async function handleClosedGroupLeftOurself(groupId: string, envelope: EnvelopeP
asyncfunctionhandleClosedGroupMemberLeft(
envelope: EnvelopePlus,
convo: ConversationModel,
shouldOnlyAddUpdateMessage: boolean// set this to true to not apply the change to the convo itself, just add the update in the conversation
shouldOnlyAddUpdateMessage: boolean,// set this to true to not apply the change to the convo itself, just add the update in the conversation
expireUpdate: DisappearingMessageUpdate|null
){
constsender=envelope.senderIdentity;
constgroupPublicKey=envelope.source;
@ -869,12 +897,13 @@ async function handleClosedGroupMemberLeft(
leavingMembers:[sender],
};
awaitClosedGroup.addUpdateMessage(
awaitClosedGroup.addUpdateMessage({
convo,
groupDiff,
envelope.senderIdentity,
toNumber(envelope.timestamp)
);
diff: groupDiff,
sender: envelope.senderIdentity,
sentAt: toNumber(envelope.timestamp),
expireUpdate,
});
convo.updateLastMessage();
// if a user just left and we are the admin, we remove him right away for everyone by sending a MEMBERS_REMOVED message so no need to add him as a zombie