Move error messages to message detail view

Change how message errors are rendered. Errors associated with a number
will be shown under that number in the detail view rather than piling up
in the message bubble.

// FREEBIE
This commit is contained in:
lilia 2015-09-30 14:27:18 -07:00
parent 9a63703340
commit 929c16090b
6 changed files with 64 additions and 23 deletions

View file

@ -58,6 +58,9 @@
if (this.isIncoming() && this.hasKeyConflicts()) {
return 'Received message with unknown identity key.';
}
if (this.isIncoming() && this.hasErrors()) {
return 'Error decrypting incoming message.';
}
return this.get('body');
},
@ -111,6 +114,9 @@
isOutgoing: function() {
return this.get('type') === 'outgoing';
},
hasErrors: function() {
return _.size(this.get('errors')) > 0;
},
hasKeyConflicts: function() {
return _.any(this.get('errors'), function(e) {
return (e.name === 'IncomingIdentityKeyError' ||