Get display name correctly

This commit is contained in:
Alex 2020-02-18 18:09:56 +01:00
parent 85d2c215bb
commit 1370a6b35f

View file

@ -327,12 +327,12 @@ func (mm *Mattermost) handlePosted(msg *model.WebSocketEvent) error {
}
userId := UserID(fmt.Sprintf("%s@%s", user.Username, mm.server))
if lastdn, ok := mm.userdisplaynamemap[userId]; !ok || lastdn != user.Nickname {
log.Warnf("Update displayname %s %s", userId, user.Nickname)
userDisp := user.GetDisplayName(model.SHOW_NICKNAME_FULLNAME)
if lastdn, ok := mm.userdisplaynamemap[userId]; !ok || lastdn != userDisp {
mm.handler.UserInfoUpdated(userId, &UserInfo{
DisplayName: user.Nickname,
DisplayName: userDisp,
})
mm.userdisplaynamemap[userId] = user.Nickname
mm.userdisplaynamemap[userId] = userDisp
}
// Build message event