Display the new key for verification after a conflict

This commit is contained in:
lilia 2015-07-20 14:15:38 -07:00
parent cc303e0802
commit 0815a96c1d
2 changed files with 14 additions and 15 deletions

View file

@ -32,7 +32,7 @@
'click': 'clickOut' 'click': 'clickOut'
}, },
triggerVerify: function() { triggerVerify: function() {
this.trigger('verify', {number: this.model.number}); this.trigger('verify', {identityKey: this.model.identityKey});
}, },
clickOut: function(e) { clickOut: function(e) {
if (!$(e.target).closest('.content').length) { if (!$(e.target).closest('.content').length) {

View file

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