diff --git a/js/delivery_receipts.js b/js/delivery_receipts.js index 831ec04c..327d2647 100644 --- a/js/delivery_receipts.js +++ b/js/delivery_receipts.js @@ -69,7 +69,7 @@ message.get('conversationId') ); if (conversation) { - conversation.trigger('newmessage', message); + conversation.trigger('delivered', message); } }); // TODO: consider keeping a list of numbers we've diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 194feaa2..33d5604e 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -80,6 +80,7 @@ this.listenTo(this.model, 'change:color', this.updateColor); this.listenTo(this.model, 'change:name', this.updateTitle); this.listenTo(this.model, 'newmessage', this.addMessage); + this.listenTo(this.model, 'delivered', this.updateMessage); this.listenTo(this.model, 'opened', this.onOpened); this.listenTo(this.model, 'expired', this.onExpired); this.listenTo(this.model.messageCollection, 'expired', this.onExpiredCollection); @@ -237,6 +238,9 @@ this.markRead(); } }, + updateMessage: function(message) { + this.model.messageCollection.add(message, {merge: true}); + }, viewMembers: function() { return this.model.fetchContacts().then(function() {