Insert keychange advisories
On click, these open a verification panel for the relevant contact, within this conversation. // FREEBIE
This commit is contained in:
parent
1f0a93bf70
commit
7fe708d195
10 changed files with 93 additions and 13 deletions
|
@ -41,6 +41,25 @@
|
|||
this.on('change:avatar', this.updateAvatarUrl);
|
||||
this.on('destroy', this.revokeAvatarUrl);
|
||||
this.on('read', this.onReadMessage);
|
||||
this.fetchContacts().then(function() {
|
||||
this.contactCollection.each(function(contact) {
|
||||
textsecure.storage.protocol.on('keychange:' + contact.id, function() {
|
||||
this.addKeyChange(contact.id);
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
addKeyChange: function(id) {
|
||||
var now = Date.now();
|
||||
var message = this.messageCollection.add({
|
||||
conversationId : this.id,
|
||||
type : 'keychange',
|
||||
sent_at : now,
|
||||
received_at : now,
|
||||
key_changed : id
|
||||
});
|
||||
message.save();
|
||||
},
|
||||
|
||||
onReadMessage: function(message) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue