aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-18 18:09:56 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-18 18:09:56 +0100
commit1370a6b35fd3e805385ea0e3ad674052627cd1f3 (patch)
tree8010e29f2c8f0aca18551ab83f68f405bc7a1374
parent85d2c215bb882a027c86db0f5ce4b93b96ceb915 (diff)
downloadeasybridge-1370a6b35fd3e805385ea0e3ad674052627cd1f3.tar.gz
easybridge-1370a6b35fd3e805385ea0e3ad674052627cd1f3.zip
Get display name correctly
-rw-r--r--connector/mattermost/mattermost.go8
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