Browse Source

Merge pull request #2078 from jitsi/contactlist_displayname

fix(ContactListPanel): default display name
j8
virtuacoplenny 8 years ago
parent
commit
095e4d7aa6
1 changed files with 21 additions and 2 deletions
  1. 21
    2
      react/features/contact-list/components/ContactListPanel.web.js

+ 21
- 2
react/features/contact-list/components/ContactListPanel.web.js View File

67
      * @returns {ReactElement[]}
67
      * @returns {ReactElement[]}
68
      */
68
      */
69
     _renderContacts() {
69
     _renderContacts() {
70
+        const { t } = this.props;
71
+        const meString = t('me');
72
+
70
         return this.props._participants.map(participant => {
73
         return this.props._participants.map(participant => {
71
-            const { id, name } = participant;
74
+            const { id, local, name } = participant;
75
+            let displayName;
76
+
77
+            // FIXME this duplicates the logic from SpeakerStats.js, but
78
+            // currently it seems that the
79
+            // interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME is freely used in
80
+            // multiple other places. A proper fix should take care of all
81
+            // usages. Also conference.js has getParticipantDisplayName which
82
+            // generates HTML span making things even harder to be cleaned up
83
+            // properly.
84
+            if (local) {
85
+                displayName
86
+                    = name ? `${name} (${meString})` : meString;
87
+            } else {
88
+                displayName
89
+                    = name ? name : interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;
90
+            }
72
 
91
 
73
             return (
92
             return (
74
                 <ContactListItem
93
                 <ContactListItem
76
                         ? getAvatarURL(participant) : null }
95
                         ? getAvatarURL(participant) : null }
77
                     id = { id }
96
                     id = { id }
78
                     key = { id }
97
                     key = { id }
79
-                    name = { name } />
98
+                    name = { displayName } />
80
             );
99
             );
81
         });
100
         });
82
     }
101
     }

Loading…
Cancel
Save