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,6 +1903,7 @@
await this.sendClosedGroupMessageWithSync(groupUpdateMessage, recipients);
if (groupUpdate.joined && groupUpdate.joined.length) {
const expireUpdate = {
timestamp: Date.now(),
expireTimer: this.get('expireTimer'),
@ -1912,7 +1913,16 @@
const expirationTimerMessage = new libsession.Messages.Outgoing.ExpirationTimerUpdateMessage(
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) {

Loading…
Cancel
Save