Skip to content

Commit

Permalink
Add 'newmessage' event handler to Conversation for reliablity
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Jul 5, 2018
1 parent ad43878 commit e30b34f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions js/models/conversations.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
this.on('change:profileKey', this.onChangeProfileKey);
this.on('destroy', this.revokeAvatarUrl);

this.on('newmessage', this.addSingleMessage);
this.on('expired', this.onExpired);
this.listenTo(
this.messageCollection,
Expand Down Expand Up @@ -145,6 +146,7 @@

addSingleMessage(message) {
const model = this.messageCollection.add(message, { merge: true });
model.setToExpire();
this.processQuotes(this.messageCollection);
return model;
},
Expand Down
3 changes: 0 additions & 3 deletions js/views/conversation_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,6 @@
// This is debounced, so it won't hit the database too often.
this.lazyUpdateVerified();

this.model.addSingleMessage(message);
message.setToExpire();

if (message.isOutgoing()) {
this.removeLastSeenIndicator();
}
Expand Down

0 comments on commit e30b34f

Please sign in to comment.