Fix failed identity key sync from contact sync

These were failing because ByteBuffers from the protobufs need to be converted
to ArrayBuffers. Fixed by useing the existing handler in MessageReceiver to
process verified messages from contact sync messages and dispatch them as their
own events, reducing some complexity on the application side.

// FREEBIE
This commit is contained in:
lilia 2017-06-23 12:24:07 -07:00 committed by Scott Nonnenberg
parent 78094102bd
commit fdce4cfc7c
3 changed files with 12 additions and 6 deletions

View file

@ -163,10 +163,6 @@
}
ConversationController.create(c).save();
if (contactDetails.verified) {
onVerified(contactDetails);
}
}
function onGroupReceived(ev) {

View file

@ -38526,10 +38526,15 @@ MessageReceiver.prototype.extend({
var ev = new Event('contact');
ev.contactDetails = contactDetails;
eventTarget.dispatchEvent(ev);
if (contactDetails.verified) {
this.handleVerified([contactDetails.verified]);
}
contactDetails = contactBuffer.next();
}
eventTarget.dispatchEvent(new Event('contactsync'));
});
}.bind(this));
},
handleGroups: function(groups) {
console.log('group sync');

View file

@ -317,10 +317,15 @@ MessageReceiver.prototype.extend({
var ev = new Event('contact');
ev.contactDetails = contactDetails;
eventTarget.dispatchEvent(ev);
if (contactDetails.verified) {
this.handleVerified([contactDetails.verified]);
}
contactDetails = contactBuffer.next();
}
eventTarget.dispatchEvent(new Event('contactsync'));
});
}.bind(this));
},
handleGroups: function(groups) {
console.log('group sync');