Unify all locations where we determine a user's display named based off of their nickname/username into a helper function

This commit is contained in:
hmhealey
2015-07-13 17:47:57 -04:00
parent abcb44089c
commit 098cbcdc21
6 changed files with 34 additions and 12 deletions

View File

@@ -487,12 +487,7 @@ func InviteMembers(team *model.Team, user *model.User, invites []string) {
teamUrl = fmt.Sprintf("http://%v.%v", team.Domain, utils.Cfg.ServiceSettings.Domain)
}
sender := ""
if len(strings.TrimSpace(user.Nickname)) == 0 {
sender = user.Username
} else {
sender = user.Nickname
}
sender := user.GetDisplayName()
senderRole := ""
if strings.Contains(user.Roles, model.ROLE_ADMIN) || strings.Contains(user.Roles, model.ROLE_SYSTEM_ADMIN) {