diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-18 18:09:56 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-18 18:09:56 +0100 |
commit | 1370a6b35fd3e805385ea0e3ad674052627cd1f3 (patch) | |
tree | 8010e29f2c8f0aca18551ab83f68f405bc7a1374 /connector | |
parent | 85d2c215bb882a027c86db0f5ce4b93b96ceb915 (diff) | |
download | easybridge-1370a6b35fd3e805385ea0e3ad674052627cd1f3.tar.gz easybridge-1370a6b35fd3e805385ea0e3ad674052627cd1f3.zip |
Get display name correctly
Diffstat (limited to 'connector')
-rw-r--r-- | connector/mattermost/mattermost.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/connector/mattermost/mattermost.go b/connector/mattermost/mattermost.go index 7c776d8..81adbde 100644 --- a/connector/mattermost/mattermost.go +++ b/connector/mattermost/mattermost.go @@ -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 |