Display the new key for verification after a conflict
This commit is contained in:
parent
cc303e0802
commit
0815a96c1d
2 changed files with 14 additions and 15 deletions
|
@ -32,7 +32,7 @@
|
|||
'click': 'clickOut'
|
||||
},
|
||||
triggerVerify: function() {
|
||||
this.trigger('verify', {number: this.model.number});
|
||||
this.trigger('verify', {identityKey: this.model.identityKey});
|
||||
},
|
||||
clickOut: function(e) {
|
||||
if (!$(e.target).closest('.content').length) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue