Plumb contact avatars into conversations

This commit is contained in:
lilia 2015-03-11 17:49:01 -07:00
parent 019a9d1fbc
commit 8e54aa1401
6 changed files with 31 additions and 9 deletions

View file

@ -42,6 +42,9 @@
},
isIncoming: function() {
return this.get('type') === 'incoming';
},
getContact: function() {
return this.collection.conversation.contactCollection.get(this.get('source'));
}
});
@ -50,6 +53,11 @@
database : Whisper.Database,
storeName : 'messages',
comparator : 'received_at',
initialize : function(models, options) {
if (options) {
this.conversation = options.conversation;
}
},
destroyAll : function () {
return Promise.all(this.models.map(function(m) {
return new Promise(function(resolve, reject) {