Update identity key after a send error tells us it has changed

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-06-22 14:03:05 -07:00
parent 22208ec3f8
commit 5e62d0cfd8
2 changed files with 23 additions and 11 deletions

View file

@ -46,6 +46,7 @@
});
this.messageCollection.on('change:errors', this.handleMessageError, this);
this.messageCollection.on('send-error', this.onMessageError, this);
this.on('change:avatar', this.updateAvatarUrl);
this.on('destroy', this.revokeAvatarUrl);
@ -55,6 +56,9 @@
return this.id === this.ourNumber;
},
onMessageError: function() {
this.updateVerified();
},
updateVerified: function() {
if (this.isPrivate()) {
return Promise.all([