Always update lastMessage on incoming messages

Fixes #742

// FREEBIE
This commit is contained in:
lilia 2016-04-14 17:32:30 -07:00
parent ba22151a31
commit 172d843368

View file

@ -347,15 +347,12 @@
var conversation_timestamp = conversation.get('timestamp');
if (!conversation_timestamp || message.get('sent_at') > conversation_timestamp) {
conversation.set({
timestamp: message.get('sent_at'),
lastMessage: message.getNotificationText()
});
}
else if (!conversation.get('lastMessage')) {
conversation.set({
lastMessage: message.getNotificationText()
timestamp: message.get('sent_at')
});
}
conversation.set({
lastMessage: message.getNotificationText()
});
message.save().then(function() {
conversation.save().then(function() {