Get display name correctly
This commit is contained in:
parent
85d2c215bb
commit
1370a6b35f
1 changed files with 4 additions and 4 deletions
|
@ -327,12 +327,12 @@ func (mm *Mattermost) handlePosted(msg *model.WebSocketEvent) error {
|
||||||
}
|
}
|
||||||
userId := UserID(fmt.Sprintf("%s@%s", user.Username, mm.server))
|
userId := UserID(fmt.Sprintf("%s@%s", user.Username, mm.server))
|
||||||
|
|
||||||
if lastdn, ok := mm.userdisplaynamemap[userId]; !ok || lastdn != user.Nickname {
|
userDisp := user.GetDisplayName(model.SHOW_NICKNAME_FULLNAME)
|
||||||
log.Warnf("Update displayname %s %s", userId, user.Nickname)
|
if lastdn, ok := mm.userdisplaynamemap[userId]; !ok || lastdn != userDisp {
|
||||||
mm.handler.UserInfoUpdated(userId, &UserInfo{
|
mm.handler.UserInfoUpdated(userId, &UserInfo{
|
||||||
DisplayName: user.Nickname,
|
DisplayName: userDisp,
|
||||||
})
|
})
|
||||||
mm.userdisplaynamemap[userId] = user.Nickname
|
mm.userdisplaynamemap[userId] = userDisp
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build message event
|
// Build message event
|
||||||
|
|
Loading…
Reference in a new issue