MessageReceiver: Wait for all code paths in handleSyncMessage

Without this, the recent changes to wait for read receipts and delivery
receipts don't have much of an effect.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-08-08 10:05:22 -07:00
parent 96b00b3e2d
commit b33c5c4c07
2 changed files with 12 additions and 12 deletions

View file

@ -38745,20 +38745,20 @@ MessageReceiver.prototype.extend({
sentMessage.expirationStartTimestamp sentMessage.expirationStartTimestamp
); );
} else if (syncMessage.contacts) { } else if (syncMessage.contacts) {
this.handleContacts(envelope, syncMessage.contacts); return this.handleContacts(envelope, syncMessage.contacts);
} else if (syncMessage.groups) { } else if (syncMessage.groups) {
this.handleGroups(envelope, syncMessage.groups); return this.handleGroups(envelope, syncMessage.groups);
} else if (syncMessage.blocked) { } else if (syncMessage.blocked) {
this.handleBlocked(envelope, syncMessage.blocked); return this.handleBlocked(envelope, syncMessage.blocked);
} else if (syncMessage.request) { } else if (syncMessage.request) {
console.log('Got SyncMessage Request'); console.log('Got SyncMessage Request');
this.removeFromCache(envelope); return this.removeFromCache(envelope);
} else if (syncMessage.read && syncMessage.read.length) { } else if (syncMessage.read && syncMessage.read.length) {
console.log('read messages', console.log('read messages',
'from', envelope.source + '.' + envelope.sourceDevice); 'from', envelope.source + '.' + envelope.sourceDevice);
this.handleRead(envelope, syncMessage.read); return this.handleRead(envelope, syncMessage.read);
} else if (syncMessage.verified) { } else if (syncMessage.verified) {
this.handleVerified(envelope, syncMessage.verified); return this.handleVerified(envelope, syncMessage.verified);
} else { } else {
throw new Error('Got empty SyncMessage'); throw new Error('Got empty SyncMessage');
} }

View file

@ -496,20 +496,20 @@ MessageReceiver.prototype.extend({
sentMessage.expirationStartTimestamp sentMessage.expirationStartTimestamp
); );
} else if (syncMessage.contacts) { } else if (syncMessage.contacts) {
this.handleContacts(envelope, syncMessage.contacts); return this.handleContacts(envelope, syncMessage.contacts);
} else if (syncMessage.groups) { } else if (syncMessage.groups) {
this.handleGroups(envelope, syncMessage.groups); return this.handleGroups(envelope, syncMessage.groups);
} else if (syncMessage.blocked) { } else if (syncMessage.blocked) {
this.handleBlocked(envelope, syncMessage.blocked); return this.handleBlocked(envelope, syncMessage.blocked);
} else if (syncMessage.request) { } else if (syncMessage.request) {
console.log('Got SyncMessage Request'); console.log('Got SyncMessage Request');
this.removeFromCache(envelope); return this.removeFromCache(envelope);
} else if (syncMessage.read && syncMessage.read.length) { } else if (syncMessage.read && syncMessage.read.length) {
console.log('read messages', console.log('read messages',
'from', envelope.source + '.' + envelope.sourceDevice); 'from', envelope.source + '.' + envelope.sourceDevice);
this.handleRead(envelope, syncMessage.read); return this.handleRead(envelope, syncMessage.read);
} else if (syncMessage.verified) { } else if (syncMessage.verified) {
this.handleVerified(envelope, syncMessage.verified); return this.handleVerified(envelope, syncMessage.verified);
} else { } else {
throw new Error('Got empty SyncMessage'); throw new Error('Got empty SyncMessage');
} }