From 8bddaeb6d755673f921d543a37d91f83ea547598 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Tue, 17 Oct 2017 14:07:20 -0500 Subject: [PATCH] fix(ContactListPanel): default display name --- .../components/ContactListPanel.web.js | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/react/features/contact-list/components/ContactListPanel.web.js b/react/features/contact-list/components/ContactListPanel.web.js index a6fefbed3..d2c15cc05 100644 --- a/react/features/contact-list/components/ContactListPanel.web.js +++ b/react/features/contact-list/components/ContactListPanel.web.js @@ -67,8 +67,27 @@ class ContactListPanel extends Component { * @returns {ReactElement[]} */ _renderContacts() { + const { t } = this.props; + const meString = t('me'); + return this.props._participants.map(participant => { - const { id, name } = participant; + const { id, local, name } = participant; + let displayName; + + // FIXME this duplicates the logic from SpeakerStats.js, but + // currently it seems that the + // interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME is freely used in + // multiple other places. A proper fix should take care of all + // usages. Also conference.js has getParticipantDisplayName which + // generates HTML span making things even harder to be cleaned up + // properly. + if (local) { + displayName + = name ? `${name} (${meString})` : meString; + } else { + displayName + = name ? name : interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME; + } return ( + name = { displayName } /> ); }); }