Skip to content

Commit

Permalink
Remove spurious update to conversation on delivery receipts
Browse files Browse the repository at this point in the history
Previously this would trigger the conversation to refresh it's last
message.

// FREEBIE
  • Loading branch information
liliakai committed Feb 22, 2017
1 parent b7fac17 commit 0e31644
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/delivery_receipts.js
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions js/views/conversation_view.js
Expand Up @@ -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);
Expand Down Expand Up @@ -237,6 +238,9 @@
this.markRead();
}
},
updateMessage: function(message) {
this.model.messageCollection.add(message, {merge: true});
},

viewMembers: function() {
return this.model.fetchContacts().then(function() {
Expand Down

0 comments on commit 0e31644

Please sign in to comment.