Update conversation snippets automatically
Fixes stale snippets after the message has expired
This commit is contained in:
parent
8d16bfb65e
commit
56aee5e8ef
2 changed files with 14 additions and 0 deletions
|
@ -167,6 +167,18 @@
|
|||
}.bind(this));
|
||||
},
|
||||
|
||||
updateLastMessage: function() {
|
||||
var lastMessage = this.messageCollection.at(this.messageCollection.length - 1);
|
||||
if (lastMessage) {
|
||||
this.save({
|
||||
lastMessage : lastMessage.getNotificationText(),
|
||||
timestamp : lastMessage.get('sent_at')
|
||||
});
|
||||
} else {
|
||||
this.save({ lastMessage: '', timestamp: null });
|
||||
}
|
||||
},
|
||||
|
||||
addExpirationTimerUpdate: function(time, source) {
|
||||
var now = Date.now();
|
||||
this.save({ expireTimer: time });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue