feat(conference.js): add 'getParticipantDisplayName'

This commit is contained in:
paweldomas 2016-09-24 11:46:19 -05:00
parent 5843c6c569
commit 62d2e3e2a4
1 changed files with 22 additions and 0 deletions

View File

@ -714,6 +714,28 @@ export default {
let participant = this.getParticipantById(id);
return participant ? participant.isConnectionActive() : null;
},
/**
* Gets the display name foe the <tt>JitsiParticipant</tt> identified by
* the given <tt>id</tt>.
*
* @param id {string} the participant's id(MUC nickname/JVB endpoint id)
*
* @return {string} the participant's display name or the default string if
* absent.
*/
getParticipantDisplayName (id) {
let displayName = getDisplayName(id);
if (displayName) {
return displayName;
} else {
if (APP.conference.isLocalId(id)) {
return APP.translation.generateTranslationHTML(
interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);
} else {
return interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;
}
}
},
getMyUserId () {
return this._room
&& this._room.myUserId();