Handle contact: don't exit early if timer is 'invalid'
This commit is contained in:
parent
621883a0ce
commit
0eb2c958a5
2 changed files with 14 additions and 17 deletions
|
@ -860,10 +860,7 @@
|
|||
);
|
||||
const { expireTimer } = details;
|
||||
const isValidExpireTimer = typeof expireTimer === 'number';
|
||||
if (!isValidExpireTimer) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isValidExpireTimer) {
|
||||
const source = textsecure.storage.user.getNumber();
|
||||
const receivedAt = Date.now();
|
||||
|
||||
|
@ -873,6 +870,7 @@
|
|||
receivedAt,
|
||||
{ fromSync: true }
|
||||
);
|
||||
}
|
||||
|
||||
if (details.verified) {
|
||||
const { verified } = details;
|
||||
|
@ -885,8 +883,6 @@
|
|||
verifiedEvent.viaContactSync = true;
|
||||
await onVerified(verifiedEvent);
|
||||
}
|
||||
|
||||
ev.confirm();
|
||||
} catch (error) {
|
||||
window.log.error('onContactReceived error:', Errors.toLogFormat(error));
|
||||
}
|
||||
|
|
|
@ -814,7 +814,6 @@ MessageReceiver.prototype.extend({
|
|||
let contactDetails = contactBuffer.next();
|
||||
while (contactDetails !== undefined) {
|
||||
const ev = new Event('contact');
|
||||
ev.confirm = this.removeFromCache.bind(this, envelope);
|
||||
ev.contactDetails = contactDetails;
|
||||
results.push(this.dispatchAndWait(ev));
|
||||
|
||||
|
@ -822,10 +821,12 @@ MessageReceiver.prototype.extend({
|
|||
}
|
||||
|
||||
const ev = new Event('contactsync');
|
||||
ev.confirm = this.removeFromCache.bind(this, envelope);
|
||||
results.push(this.dispatchAndWait(ev));
|
||||
|
||||
return Promise.all(results);
|
||||
return Promise.all(results).then(() => {
|
||||
window.log.info('handleContacts: finished');
|
||||
return this.removeFromCache(envelope);
|
||||
});
|
||||
});
|
||||
},
|
||||
handleGroups(envelope, groups) {
|
||||
|
|
Loading…
Reference in a new issue