summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-08-30 23:04:50 +0200
committerWim <wim@42.be>2018-08-30 23:04:50 +0200
commit330ddb6a308bbdb1456b1cc83f364315be764752 (patch)
treef46c6f55160a3ba36ac633369c5f5310bf3eb147 /bridge
parent52dbd702add381a96f543523dec71741e4832ad6 (diff)
downloadmatterbridge-msglm-330ddb6a308bbdb1456b1cc83f364315be764752.tar.gz
matterbridge-msglm-330ddb6a308bbdb1456b1cc83f364315be764752.tar.bz2
matterbridge-msglm-330ddb6a308bbdb1456b1cc83f364315be764752.zip
Fix panic by using matterclient calls in the right place. Related to cb7278eb (mattermost). Closes #491
Diffstat (limited to 'bridge')
-rw-r--r--bridge/mattermost/mattermost.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index ce77b062..12b5097f 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -185,9 +185,6 @@ func (b *Bmattermost) handleMatter() {
for message := range messages {
message.Avatar = helper.GetAvatar(b.avatarMap, message.UserID, b.General)
message.Account = b.Account
- if nick := b.mc.GetNickName(message.UserID); nick != "" {
- message.Username = nick
- }
message.Text, ok = b.replaceAction(message.Text)
if ok {
message.Event = config.EVENT_USER_ACTION
@@ -256,6 +253,11 @@ func (b *Bmattermost) handleMatterClient(messages chan *config.Message) {
}
}
}
+ // Use nickname instead of username if defined
+ if nick := b.mc.GetNickName(rmsg.UserID); nick != "" {
+ rmsg.Username = nick
+ }
+
messages <- rmsg
}
}