Merge pull request #1517 from Bilb/include-user-details-config-message

do not send expire timer to member added on closed group
pull/1516/head
Audric Ackermann 4 years ago committed by GitHub
commit 6aa3e5b7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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