diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-06-30 16:06:59 +0800 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-06-30 09:06:59 +0100 |
commit | eea64f8049d90c5dcf14a739d640f5aa6a9c7add (patch) | |
tree | fabaa232bad7f4ebddf30b073c37a5962029f7fd /model/user.go | |
parent | fb57b3dd53eaca28a557ea7e334e9d7216ce6aab (diff) | |
download | chat-eea64f8049d90c5dcf14a739d640f5aa6a9c7add.tar.gz chat-eea64f8049d90c5dcf14a739d640f5aa6a9c7add.tar.bz2 chat-eea64f8049d90c5dcf14a739d640f5aa6a9c7add.zip |
[PLT-5864] Move teammate name display setting to the System Console (#6681)
* move teammate name display setting to the system console
* update all the likes of TeammateNameDisplay names
* fix gofmt error
* rebase and fix conflict
Diffstat (limited to 'model/user.go')
-rw-r--r-- | model/user.go | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/model/user.go b/model/user.go index 970e777fc..8e5c8fcc1 100644 --- a/model/user.go +++ b/model/user.go @@ -383,26 +383,16 @@ func (u *User) GetFullName() string { } } -func (u *User) GetDisplayName() string { - if u.Nickname != "" { - return u.Nickname - } else if fullName := u.GetFullName(); fullName != "" { - return fullName - } else { - return u.Username - } -} - -func (u *User) GetDisplayNameForPreference(nameFormat string) string { +func (u *User) GetDisplayName(nameFormat string) string { displayName := u.Username - if nameFormat == PREFERENCE_VALUE_DISPLAY_NAME_NICKNAME { + if nameFormat == SHOW_NICKNAME_FULLNAME { if u.Nickname != "" { displayName = u.Nickname } else if fullName := u.GetFullName(); fullName != "" { displayName = fullName } - } else if nameFormat == PREFERENCE_VALUE_DISPLAY_NAME_FULL { + } else if nameFormat == SHOW_FULLNAME { if fullName := u.GetFullName(); fullName != "" { displayName = fullName } |