diff options
-rw-r--r-- | bridge/config/config.go | 2 | ||||
-rw-r--r-- | bridge/mattermost/handlers.go | 12 | ||||
-rw-r--r-- | matterbridge.toml.sample | 4 |
3 files changed, 13 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 diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 8bc0f6c1..63a614d1 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -408,6 +408,10 @@ SkipTLSVerify=true ## RELOADABLE SETTINGS ## Settings below can be reloaded by editing the file +# UseUserName shows the username instead of the server nickname +# OPTIONAL (default false) +UseUserName=false + #how to format the list of IRC nicks when displayed in mattermost. #Possible options are "table" and "plain" #OPTIONAL (default plain) |