From 468a05c6f1f2e14218cbf7fa083dd9ab9fb73612 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Tue, 17 Oct 2017 21:32:35 +0200 Subject: [PATCH] Fix SenderProfile Signed-off-by: Stefan Parviainen --- src/components/views/messages/SenderProfile.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/views/messages/SenderProfile.js b/src/components/views/messages/SenderProfile.js index f6940cd4b3..afdb97272f 100644 --- a/src/components/views/messages/SenderProfile.js +++ b/src/components/views/messages/SenderProfile.js @@ -27,30 +27,29 @@ export default function SenderProfile(props) { const name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender(); const {msgtype} = mxEvent.getContent(); - // Display sender name by default if nothing else is given - const text = props.text ? props.text : '%(senderName)s'; - if (msgtype === 'm.emote') { return ; // emote message must include the name so don't duplicate it } // Name + flair const nameElem = [ - { name || '' }, + { name || '' }, props.enableFlair ? - : null, - ] + ]; + + let content = ''; if(props.text) { // Replace senderName, and wrap surrounding text in spans with the right class content = _tJsx(props.text, /^(.*)\%\(senderName\)s(.*)$/m, (p1, p2) => [ - p1 ? {p1} : null, + p1 ? { p1 } : null, nameElem, - p2 ? {p2} : null, + p2 ? { p2 } : null, ]); } else { content = nameElem;