Handle and send isRecipientUpdate sync messages

* Handle and send isRecipientUpdate sync messages
* Disable sending isRecipientUpdates for now
This commit is contained in:
Scott Nonnenberg 2019-05-09 08:38:05 -07:00
parent 8c365b1a3a
commit 13ad4abaea
5 changed files with 128 additions and 56 deletions

View file

@ -1113,7 +1113,7 @@
this.trigger('done');
// This is used by sendSyncMessage, then set to null
if (!this.get('synced') && result.dataMessage) {
if (result.dataMessage) {
this.set({ dataMessage: result.dataMessage });
}
@ -1244,9 +1244,16 @@
this.syncPromise = this.syncPromise || Promise.resolve();
const next = () => {
const dataMessage = this.get('dataMessage');
if (this.get('synced') || !dataMessage) {
if (!dataMessage) {
return Promise.resolve();
}
const isUpdate = Boolean(this.get('synced'));
// Until isRecipientUpdate sync messages are widely supported, will not send them
if (isUpdate) {
return Promise.resolve();
}
return wrap(
textsecure.messaging.sendSyncMessage(
dataMessage,
@ -1255,6 +1262,7 @@
this.get('expirationStartTimestamp'),
this.get('sent_to'),
this.get('unidentifiedDeliveries'),
isUpdate,
sendOptions
)
).then(result => {