Show contact name when you reply to message with a contact

This commit is contained in:
Scott Nonnenberg 2018-05-07 15:44:19 -07:00
parent cdfe4d76b1
commit 8beeef4d10
3 changed files with 16 additions and 8 deletions

View file

@ -711,13 +711,21 @@
},
async makeQuote(quotedMessage) {
const { getName } = Signal.Types.Contact;
const contact = quotedMessage.getContact();
const attachments = quotedMessage.get('attachments');
const body = quotedMessage.get('body');
const embeddedContact = quotedMessage.get('contact');
const embeddedContactName =
embeddedContact && embeddedContact.length > 0
? getName(embeddedContact[0])
: '';
return {
author: contact.id,
id: quotedMessage.get('sent_at'),
text: quotedMessage.get('body'),
text: body || embeddedContactName,
attachments: await Promise.all(
(attachments || []).map(async attachment => {
const { contentType } = attachment;