summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-02-06 17:33:41 +0100
committerGitHub <noreply@github.com>2022-02-06 17:33:41 +0100
commitc8d7fdeedcc2fe596055da000bfa8c23c4ba5cab (patch)
treec708b8459745f2c7903f7fa439108fb5cfd66be7 /bridge/mattermost
parentc211152e236878b72d1a711ba0c6bef5dca07fb2 (diff)
downloadmatterbridge-msglm-c8d7fdeedcc2fe596055da000bfa8c23c4ba5cab.tar.gz
matterbridge-msglm-c8d7fdeedcc2fe596055da000bfa8c23c4ba5cab.tar.bz2
matterbridge-msglm-c8d7fdeedcc2fe596055da000bfa8c23c4ba5cab.zip
Add UseUsername option (mattermost). Fixes #1665 (#1714)
Diffstat (limited to 'bridge/mattermost')
-rw-r--r--bridge/mattermost/handlers.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/bridge/mattermost/handlers.go b/bridge/mattermost/handlers.go
index 5ad40115..00c9445d 100644
--- a/bridge/mattermost/handlers.go
+++ b/bridge/mattermost/handlers.go
@@ -177,8 +177,10 @@ 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
+ if !b.GetBool("useusername") {
+ if nick := b.mc.GetNickName(rmsg.UserID); nick != "" {
+ rmsg.Username = nick
+ }
}
messages <- rmsg
@@ -232,8 +234,10 @@ func (b *Bmattermost) handleMatterClient6(messages chan *config.Message) {
}
// Use nickname instead of username if defined
- if nick := b.mc6.GetNickName(rmsg.UserID); nick != "" {
- rmsg.Username = nick
+ if !b.GetBool("useusername") {
+ if nick := b.mc6.GetNickName(rmsg.UserID); nick != "" {
+ rmsg.Username = nick
+ }
}
messages <- rmsg