trigger send of expiretimer message ongroupupdate or groupInfo

pull/1223/head
Audric Ackermann 5 years ago
parent 0366f29473
commit 2a26f4af50
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1868,9 +1868,20 @@
); );
await this.sendClosedGroupMessageWithSync(groupUpdateMessage, recipients); await this.sendClosedGroupMessageWithSync(groupUpdateMessage, recipients);
const expireUpdate = {
timestamp: Date.now(),
expireTimer: this.get('expireTimer'),
groupId: this.get('id'),
};
const expirationTimerMessage = new libsession.Messages.Outgoing.ExpirationTimerUpdateMessage(
expireUpdate
);
await libsession.getMessageQueue().sendToGroup(expirationTimerMessage);
}, },
sendGroupInfo(recipient) { async sendGroupInfo(recipient) {
// Only send group info if we're a closed group and we haven't left // Only send group info if we're a closed group and we haven't left
if (this.isClosedGroup() && !this.get('left')) { if (this.isClosedGroup() && !this.get('left')) {
const updateParams = { const updateParams = {
@ -1889,10 +1900,25 @@
window.console.warn('sendGroupInfo invalid pubkey:', recipient); window.console.warn('sendGroupInfo invalid pubkey:', recipient);
return; return;
} }
libsession await libsession
.getMessageQueue() .getMessageQueue()
.send(recipientPubKey, groupUpdateMessage) .send(recipientPubKey, groupUpdateMessage)
.catch(log.error); .catch(log.error);
const expireUpdate = {
timestamp: Date.now(),
expireTimer: this.get('expireTimer'),
groupId: this.get('id'),
};
const expirationTimerMessage = new libsession.Messages.Outgoing.ExpirationTimerUpdateMessage(
expireUpdate
);
await libsession
.getMessageQueue()
.sendUsingMultiDevice(recipientPubKey, expirationTimerMessage)
.catch(log.error);
} }
}, },

@ -1096,7 +1096,7 @@
attachments, attachments,
preview, preview,
quote, quote,
lokiProfile: this.getOurProfile(), lokiProfile: this.conversation.getOurProfile(),
}); });
// Special-case the self-send case - we send only a sync message // Special-case the self-send case - we send only a sync message

Loading…
Cancel
Save