do not send expire timer to member added on closed group

pull/1517/head
Audric Ackermann 4 years ago
parent 215cffdd75
commit 08c41004a2
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -442,27 +442,27 @@ async function sendAddedMembers(
}); });
// if an expire timer is set, we have to send it to the joining members // if an expire timer is set, we have to send it to the joining members
let expirationTimerMessage: ExpirationTimerUpdateMessage | undefined; // let expirationTimerMessage: ExpirationTimerUpdateMessage | undefined;
if (expireTimer && expireTimer > 0) { // if (expireTimer && expireTimer > 0) {
const expireUpdate = { // const expireUpdate = {
timestamp: Date.now(), // timestamp: Date.now(),
expireTimer, // expireTimer,
groupId: groupId, // groupId: groupId,
}; // };
expirationTimerMessage = new ExpirationTimerUpdateMessage(expireUpdate); // expirationTimerMessage = new ExpirationTimerUpdateMessage(expireUpdate);
} // }
const promises = addedMembers.map(async m => { const promises = addedMembers.map(async m => {
await ConversationController.getInstance().getOrCreateAndWait(m, 'private'); await ConversationController.getInstance().getOrCreateAndWait(m, 'private');
const memberPubKey = PubKey.cast(m); const memberPubKey = PubKey.cast(m);
await getMessageQueue().sendToPubKey(memberPubKey, newClosedGroupUpdate); await getMessageQueue().sendToPubKey(memberPubKey, newClosedGroupUpdate);
if (expirationTimerMessage) { // if (expirationTimerMessage) {
await getMessageQueue().sendToPubKey( // await getMessageQueue().sendToPubKey(
memberPubKey, // memberPubKey,
expirationTimerMessage // expirationTimerMessage
); // );
} // }
}); });
await Promise.all(promises); await Promise.all(promises);
} }

Loading…
Cancel
Save