Protos: Update to optional verified in sync (was: repeated)
This means that we no longer need to iterate. FREEBIE
This commit is contained in:
parent
fdce4cfc7c
commit
f414c13220
3 changed files with 17 additions and 21 deletions
|
@ -38494,15 +38494,13 @@ MessageReceiver.prototype.extend({
|
|||
}
|
||||
},
|
||||
handleVerified: function(verified) {
|
||||
for (var i = 0; i < verified.length; ++i) {
|
||||
var ev = new Event('verified');
|
||||
ev.verified = {
|
||||
state: verified[i].state,
|
||||
destination: verified[i].destination,
|
||||
identityKey: verified[i].identityKey.toArrayBuffer()
|
||||
};
|
||||
this.dispatchEvent(ev);
|
||||
}
|
||||
var ev = new Event('verified');
|
||||
ev.verified = {
|
||||
state: verified.state,
|
||||
destination: verified.destination,
|
||||
identityKey: verified.identityKey.toArrayBuffer()
|
||||
};
|
||||
this.dispatchEvent(ev);
|
||||
},
|
||||
handleRead: function(read, timestamp) {
|
||||
for (var i = 0; i < read.length; ++i) {
|
||||
|
@ -38528,7 +38526,7 @@ MessageReceiver.prototype.extend({
|
|||
eventTarget.dispatchEvent(ev);
|
||||
|
||||
if (contactDetails.verified) {
|
||||
this.handleVerified([contactDetails.verified]);
|
||||
this.handleVerified(contactDetails.verified);
|
||||
}
|
||||
|
||||
contactDetails = contactBuffer.next();
|
||||
|
|
|
@ -285,15 +285,13 @@ MessageReceiver.prototype.extend({
|
|||
}
|
||||
},
|
||||
handleVerified: function(verified) {
|
||||
for (var i = 0; i < verified.length; ++i) {
|
||||
var ev = new Event('verified');
|
||||
ev.verified = {
|
||||
state: verified[i].state,
|
||||
destination: verified[i].destination,
|
||||
identityKey: verified[i].identityKey.toArrayBuffer()
|
||||
};
|
||||
this.dispatchEvent(ev);
|
||||
}
|
||||
var ev = new Event('verified');
|
||||
ev.verified = {
|
||||
state: verified.state,
|
||||
destination: verified.destination,
|
||||
identityKey: verified.identityKey.toArrayBuffer()
|
||||
};
|
||||
this.dispatchEvent(ev);
|
||||
},
|
||||
handleRead: function(read, timestamp) {
|
||||
for (var i = 0; i < read.length; ++i) {
|
||||
|
@ -319,7 +317,7 @@ MessageReceiver.prototype.extend({
|
|||
eventTarget.dispatchEvent(ev);
|
||||
|
||||
if (contactDetails.verified) {
|
||||
this.handleVerified([contactDetails.verified]);
|
||||
this.handleVerified(contactDetails.verified);
|
||||
}
|
||||
|
||||
contactDetails = contactBuffer.next();
|
||||
|
|
|
@ -135,7 +135,7 @@ message SyncMessage {
|
|||
optional Request request = 4;
|
||||
repeated Read read = 5;
|
||||
optional Blocked blocked = 6;
|
||||
repeated Verified verified = 7;
|
||||
optional Verified verified = 7;
|
||||
optional bytes padding = 8;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue