diff options
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/config/config.go | 2 | ||||
-rw-r--r-- | bridge/mattermost/handlers.go | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go index 16b397f3..18c60920 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -170,7 +170,7 @@ type Protocol struct { UseTLS bool // IRC UseDiscriminator bool // discord UseFirstName bool // telegram - UseUserName bool // discord, matrix + UseUserName bool // discord, matrix, mattermost UseInsecureURL bool // telegram UserName string // IRC VerboseJoinPart bool // IRC 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 |