Fix panic by using matterclient calls in the right place. Related to cb7278eb
(mattermost). Closes #491
This commit is contained in:
parent
52dbd702ad
commit
330ddb6a30
|
@ -185,9 +185,6 @@ func (b *Bmattermost) handleMatter() {
|
||||||
for message := range messages {
|
for message := range messages {
|
||||||
message.Avatar = helper.GetAvatar(b.avatarMap, message.UserID, b.General)
|
message.Avatar = helper.GetAvatar(b.avatarMap, message.UserID, b.General)
|
||||||
message.Account = b.Account
|
message.Account = b.Account
|
||||||
if nick := b.mc.GetNickName(message.UserID); nick != "" {
|
|
||||||
message.Username = nick
|
|
||||||
}
|
|
||||||
message.Text, ok = b.replaceAction(message.Text)
|
message.Text, ok = b.replaceAction(message.Text)
|
||||||
if ok {
|
if ok {
|
||||||
message.Event = config.EVENT_USER_ACTION
|
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
|
messages <- rmsg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue