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 { expireTimer } = details;
|
||||||
const isValidExpireTimer = typeof expireTimer === 'number';
|
const isValidExpireTimer = typeof expireTimer === 'number';
|
||||||
if (!isValidExpireTimer) {
|
if (isValidExpireTimer) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const source = textsecure.storage.user.getNumber();
|
const source = textsecure.storage.user.getNumber();
|
||||||
const receivedAt = Date.now();
|
const receivedAt = Date.now();
|
||||||
|
|
||||||
|
@ -873,6 +870,7 @@
|
||||||
receivedAt,
|
receivedAt,
|
||||||
{ fromSync: true }
|
{ fromSync: true }
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (details.verified) {
|
if (details.verified) {
|
||||||
const { verified } = details;
|
const { verified } = details;
|
||||||
|
@ -885,8 +883,6 @@
|
||||||
verifiedEvent.viaContactSync = true;
|
verifiedEvent.viaContactSync = true;
|
||||||
await onVerified(verifiedEvent);
|
await onVerified(verifiedEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
ev.confirm();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.log.error('onContactReceived error:', Errors.toLogFormat(error));
|
window.log.error('onContactReceived error:', Errors.toLogFormat(error));
|
||||||
}
|
}
|
||||||
|
|
|
@ -814,7 +814,6 @@ MessageReceiver.prototype.extend({
|
||||||
let contactDetails = contactBuffer.next();
|
let contactDetails = contactBuffer.next();
|
||||||
while (contactDetails !== undefined) {
|
while (contactDetails !== undefined) {
|
||||||
const ev = new Event('contact');
|
const ev = new Event('contact');
|
||||||
ev.confirm = this.removeFromCache.bind(this, envelope);
|
|
||||||
ev.contactDetails = contactDetails;
|
ev.contactDetails = contactDetails;
|
||||||
results.push(this.dispatchAndWait(ev));
|
results.push(this.dispatchAndWait(ev));
|
||||||
|
|
||||||
|
@ -822,10 +821,12 @@ MessageReceiver.prototype.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
const ev = new Event('contactsync');
|
const ev = new Event('contactsync');
|
||||||
ev.confirm = this.removeFromCache.bind(this, envelope);
|
|
||||||
results.push(this.dispatchAndWait(ev));
|
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) {
|
handleGroups(envelope, groups) {
|
||||||
|
|
Loading…
Reference in a new issue