Merge remote-tracking branch 'upstream/clearnet' into move-models-to-ts-2

pull/1495/head
Audric Ackermann 4 years ago
commit 20cf5dbf10
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -21,7 +21,6 @@ import {
ClosedGroupNameChangeMessage,
ClosedGroupNewMessage,
ClosedGroupRemovedMembersMessage,
ClosedGroupUpdateMessage,
} from '../messages/outgoing/content/data/group';
import { ConversationModel } from '../../models/conversation';
import { MessageModel } from '../../models/message';
@ -442,28 +441,10 @@ async function sendAddedMembers(
expireTimer,
});
// 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);
}
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
);
}
});
await Promise.all(promises);
}

Loading…
Cancel
Save