Support for sending and receiving verification sync messages
This adds a new method to message sender for sending verification sync messages and a new event to message receiver representing incoming verification sync messages. Currently the event handler just logs the message. // FREEBIE
This commit is contained in:
parent
475d607fd0
commit
52481d1d13
4 changed files with 88 additions and 1 deletions
|
@ -119,7 +119,7 @@
|
|||
messageReceiver.addEventListener('group', onGroupReceived);
|
||||
messageReceiver.addEventListener('sent', onSentMessage);
|
||||
messageReceiver.addEventListener('read', onReadReceipt);
|
||||
// messageReceiver.addEventListener('verify', onVerify);
|
||||
messageReceiver.addEventListener('verification', onVerify);
|
||||
messageReceiver.addEventListener('error', onError);
|
||||
|
||||
|
||||
|
@ -326,6 +326,29 @@
|
|||
});
|
||||
}
|
||||
|
||||
function onVerification(ev) {
|
||||
var state;
|
||||
switch(ev.state) {
|
||||
case textsecure.protobuf.Verification.State.DEFAULT:
|
||||
state = 'DEFAULT';
|
||||
break;
|
||||
case textsecure.protobuf.Verification.State.VERIFIED:
|
||||
state = 'VERIFIED';
|
||||
break;
|
||||
case textsecure.protobuf.Verification.State.NO_LONGER_VERIFIED:
|
||||
state = 'UNVERIFIED';
|
||||
break;
|
||||
}
|
||||
console.log('got verification sync for', ev.destination, state);
|
||||
/* TODO
|
||||
processVerifiedMessage(
|
||||
textsecure.storage.protocol.VerifiedStatus[state],
|
||||
ev.destination,
|
||||
ev.identityKey
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
window.owsDesktopApp = {
|
||||
getAppView: function(destWindow) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue