Use contact name when updating last message for a conversation

This commit is contained in:
Scott Nonnenberg 2018-05-08 18:19:35 -07:00
parent aa13a2c6f7
commit 93d3abbf8d

View file

@ -16,7 +16,7 @@
window.Whisper = window.Whisper || {};
const { Message: TypedMessage } = Signal.Types;
const { Message: TypedMessage, Contact } = Signal.Types;
const { deleteAttachmentData } = Signal.Migrations;
window.Whisper.Message = Backbone.Model.extend({
@ -162,6 +162,10 @@
const conversation = this.getModelForKeyChange();
return i18n('keychanged', conversation.getTitle());
}
const contacts = this.get('contact');
if (contacts && contacts.length) {
return Contact.getName(contacts[0]);
}
return '';
},