Skip to content

Commit

Permalink
Merge pull request #1517 from Bilb/include-user-details-config-message
Browse files Browse the repository at this point in the history
do not send expire timer to member added on closed group
  • Loading branch information
Bilb authored Feb 25, 2021
2 parents 15c9395 + 08c4100 commit 6aa3e5b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions ts/session/group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,27 +442,27 @@ async function sendAddedMembers(
});

// if an expire timer is set, we have to send it to the joining members
let expirationTimerMessage: ExpirationTimerUpdateMessage | undefined;
if (expireTimer && expireTimer > 0) {
const expireUpdate = {
timestamp: Date.now(),
expireTimer,
groupId: groupId,
};

expirationTimerMessage = new ExpirationTimerUpdateMessage(expireUpdate);
}
// let expirationTimerMessage: ExpirationTimerUpdateMessage | undefined;
// if (expireTimer && expireTimer > 0) {
// const expireUpdate = {
// timestamp: Date.now(),
// expireTimer,
// groupId: groupId,
// };

// expirationTimerMessage = new ExpirationTimerUpdateMessage(expireUpdate);
// }
const promises = addedMembers.map(async m => {
await ConversationController.getInstance().getOrCreateAndWait(m, 'private');
const memberPubKey = PubKey.cast(m);
await getMessageQueue().sendToPubKey(memberPubKey, newClosedGroupUpdate);

if (expirationTimerMessage) {
await getMessageQueue().sendToPubKey(
memberPubKey,
expirationTimerMessage
);
}
// if (expirationTimerMessage) {
// await getMessageQueue().sendToPubKey(
// memberPubKey,
// expirationTimerMessage
// );
// }
});
await Promise.all(promises);
}
Expand Down

0 comments on commit 6aa3e5b

Please sign in to comment.