From 0e31644c282decebe7149300c9bb632249a1826b Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 22 Feb 2017 13:20:04 -0800 Subject: [PATCH] Remove spurious update to conversation on delivery receipts Previously this would trigger the conversation to refresh it's last message. // FREEBIE --- js/delivery_receipts.js | 2 +- js/views/conversation_view.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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() {