Fix blank lastMessage for non-text messages

For non text messages (ex: media messages and group updates), the
lastMessage field was being populated with empty string, resulting in an
empty message preview in the conversation list. Instead, display 'Media
message' or 'Updated the group', etc...

// FREEBIE
This commit is contained in:
lilia 2015-11-02 16:27:42 -08:00
parent b18cfd75de
commit 503509fc8f

View file

@ -307,12 +307,12 @@
if (!conversation_timestamp || message.get('sent_at') > conversation_timestamp) {
conversation.set({
timestamp: message.get('sent_at'),
lastMessage: message.get('body')
lastMessage: message.getDescription()
});
}
else if (!conversation.get('lastMessage')) {
conversation.set({
lastMessage: message.get('body')
lastMessage: message.getDescription()
});
}