From 93d3abbf8dba76c90c50f7acd7217ee4a078dbbb Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 8 May 2018 18:19:35 -0700 Subject: [PATCH] Use contact name when updating last message for a conversation --- js/models/messages.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/models/messages.js b/js/models/messages.js index 40db85569..eebe99a7f 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -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 ''; },