|
|
|
@ -54,19 +54,18 @@
|
|
|
|
|
goBack: function() {
|
|
|
|
|
this.trigger('back');
|
|
|
|
|
},
|
|
|
|
|
verify: function(number) {
|
|
|
|
|
var view = new Whisper.KeyVerificationView({
|
|
|
|
|
model: {
|
|
|
|
|
their_key: textsecure.storage.axolotl.getIdentityKey(number),
|
|
|
|
|
your_key: textsecure.storage.axolotl.getIdentityKey(textsecure.storage.user.getNumber())
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$el.hide();
|
|
|
|
|
view.render().$el.insertAfter(this.el);
|
|
|
|
|
this.listenTo(view, 'back', function() {
|
|
|
|
|
view.remove();
|
|
|
|
|
this.$el.show();
|
|
|
|
|
});
|
|
|
|
|
verify: function(their_key) {
|
|
|
|
|
textsecure.storage.axolotl.getIdentityKey(textsecure.storage.user.getNumber()).then(function(our_key) {
|
|
|
|
|
var view = new Whisper.KeyVerificationView({
|
|
|
|
|
model: { their_key: their_key, your_key: our_key }
|
|
|
|
|
});
|
|
|
|
|
this.$el.hide();
|
|
|
|
|
view.render().$el.insertAfter(this.el);
|
|
|
|
|
this.listenTo(view, 'back', function() {
|
|
|
|
|
view.remove();
|
|
|
|
|
this.$el.show();
|
|
|
|
|
}.bind(this));
|
|
|
|
|
}.bind(this));
|
|
|
|
|
},
|
|
|
|
|
contacts: function() {
|
|
|
|
|
if (this.model.isIncoming()) {
|
|
|
|
@ -83,7 +82,7 @@
|
|
|
|
|
});
|
|
|
|
|
view.render().$el.appendTo(this.$el);
|
|
|
|
|
this.listenTo(view, 'verify', function(data) {
|
|
|
|
|
this.verify(data.number);
|
|
|
|
|
this.verify(data.identityKey);
|
|
|
|
|
});
|
|
|
|
|
this.listenTo(view, 'resolve', function() {
|
|
|
|
|
this.render();
|
|
|
|
|