send expiration timer update only to added members in closed group

pull/1231/head
Audric Ackermann 5 years ago
parent aa635e9cd3
commit 465c78b2ee
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1903,16 +1903,26 @@
await this.sendClosedGroupMessageWithSync(groupUpdateMessage, recipients); await this.sendClosedGroupMessageWithSync(groupUpdateMessage, recipients);
const expireUpdate = { if (groupUpdate.joined && groupUpdate.joined.length) {
timestamp: Date.now(), const expireUpdate = {
expireTimer: this.get('expireTimer'), timestamp: Date.now(),
groupId: this.get('id'), expireTimer: this.get('expireTimer'),
}; groupId: this.get('id'),
};
const expirationTimerMessage = new libsession.Messages.Outgoing.ExpirationTimerUpdateMessage( const expirationTimerMessage = new libsession.Messages.Outgoing.ExpirationTimerUpdateMessage(
expireUpdate expireUpdate
); );
await libsession.getMessageQueue().sendToGroup(expirationTimerMessage); await Promise.all(
groupUpdate.joined.map(async join => {
const device = new libsession.Types.PubKey(join);
await libsession
.getMessageQueue()
.sendUsingMultiDevice(device, expirationTimerMessage)
.catch(log.error);
})
);
}
}, },
async sendGroupInfo(recipient) { async sendGroupInfo(recipient) {

Loading…
Cancel
Save