Merge pull request #1259 from stasvovk/PLT-639

PLT-639: display full name, nickname or username in direct messages
Этот коммит содержится в:
Christopher Speller
2015-11-02 14:10:59 -05:00
родитель 16171468dd bc57489d8b
Коммит 17233b1dce
4 изменённых файлов: 120 добавлений и 6 удалений

Просмотреть файл

@@ -884,6 +884,23 @@ export function getDisplayName(user) {
return user.username;
}
export function displayUsername(userId) {
const user = UserStore.getProfile(userId);
const nameFormat = PreferenceStore.getPreference(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', {value: 'false'}).value;
let username = '';
if (nameFormat === 'nickname_full_name') {
username = user.nickname || getFullName(user);
} else if (nameFormat === 'full_name') {
username = getFullName(user);
}
if (!username.trim().length) {
username = user.username;
}
return username;
}
//IE10 does not set window.location.origin automatically so this must be called instead when using it
export function getWindowLocationOrigin() {
var windowLocationOrigin = window.location.origin;