|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|