Improve notification behavior

Only allow one notification at a time. Use a basic notification for
normal messages, and image notification for image messages, and a list
notification when there are multiple unread messages.

// FREEBIE
This commit is contained in:
lilia 2015-09-13 20:25:04 -07:00
parent 59313b5177
commit e8edbe53bc
4 changed files with 133 additions and 27 deletions

View file

@ -61,9 +61,20 @@
return this.get('body');
},
getNotificationText: function() {
var description = this.getDescription();
if (description) {
return description;
}
if (this.get('attachments').length > 0) {
return 'Media message';
}
return '';
},
updateImageUrl: function() {
this.revokeImageUrl();
var attachment = message.get('attachments')[0];
var attachment = this.get('attachments')[0];
if (attachment) {
var blob = new Blob([attachment.data], {
type: attachment.contentType