diff options
author | Patrick Connolly <patrick.c.connolly@gmail.com> | 2018-10-24 03:53:11 +0800 |
---|---|---|
committer | Wim <wim@42.be> | 2018-10-23 21:53:11 +0200 |
commit | 291594b99ceb56b5da354bd093b6a04f43e24d4e (patch) | |
tree | e15c14019eb3021f77e9e3ad4cc58a56b2349881 | |
parent | f2cdda7278e01b548f8aff6567376ae2f15c1803 (diff) | |
download | matterbridge-msglm-291594b99ceb56b5da354bd093b6a04f43e24d4e.tar.gz matterbridge-msglm-291594b99ceb56b5da354bd093b6a04f43e24d4e.tar.bz2 matterbridge-msglm-291594b99ceb56b5da354bd093b6a04f43e24d4e.zip |
Allow origin CHANNEL to be used in RemoteNickFormat (#515)
* Added origin CHANNEL to RemoteNickFormat. Updated config docs. [Fixes #515]
* Update matterbridge.toml.sample
Co-Authored-By: patcon <patrick.c.connolly@gmail.com>
-rw-r--r-- | gateway/gateway.go | 1 | ||||
-rw-r--r-- | matterbridge.toml.sample | 81 |
2 files changed, 16 insertions, 66 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go index a33a9a97..5bfb00e2 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -377,6 +377,7 @@ func (gw *Gateway) modifyUsername(msg config.Message, dest *bridge.Bridge) strin nick = strings.Replace(nick, "{GATEWAY}", gw.Name, -1) nick = strings.Replace(nick, "{LABEL}", br.GetString("Label"), -1) nick = strings.Replace(nick, "{NICK}", msg.Username, -1) + nick = strings.Replace(nick, "{CHANNEL}", msg.Channel, -1) return nick } diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 790eaadc..0ec55962 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -129,12 +129,8 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge +#See [general] config section for default options #The string "{NOPINGNICK}" (case sensitive) will be replaced by the actual nick / username, but with a ZWSP inside the nick, so the irc user with the same nick won't get pinged. See https://github.com/42wim/matterbridge/issues/175 for more information -#OPTIONAL (default empty) RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -227,11 +223,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -311,11 +303,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}/{BRIDGE}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -455,11 +443,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -534,11 +518,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -656,11 +636,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -759,11 +735,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -866,16 +838,11 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge +#See [general] config section for default options # #WARNING: if you have set MessageFormat="HTML" be sure that this format matches the guidelines #on https://core.telegram.org/bots/api#html-style otherwise the message will not go through to #telegram! eg <{NICK}> should be <{NICK}> -# -#OPTIONAL (default empty) RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -969,11 +936,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -1059,11 +1022,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -1143,11 +1102,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -1227,11 +1182,7 @@ ReplaceNicks=[ ["user--","user"] ] Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="[{PROTOCOL}] <{NICK}> " #Enable to show users joins/parts from other bridges @@ -1275,11 +1226,7 @@ Token="mytoken" Label="" #RemoteNickFormat defines how remote users appear on this bridge -#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username. -#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge -#The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge -#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge -#OPTIONAL (default empty) +#See [general] config section for default options RemoteNickFormat="{NICK}" @@ -1298,6 +1245,8 @@ RemoteNickFormat="{NICK}" #The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge #The string "{LABEL}" (case sensitive) will be replaced by label= field of the sending bridge #The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge +#The string "{GATEWAY}" (case sensitive) will be replaced by the origin gateway name that is replicating the message. +#The string "{CHANNEL}" (case sensitive) will be replaced by the origin channel name used by the bridge #OPTIONAL (default empty) RemoteNickFormat="[{PROTOCOL}] <{NICK}> " |