Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit b292f3c7d7a2706f3dfca953d66b15f2ae4568de Author: Wim <wim@42.be> Date: Tue Feb 20 18:57:46 2018 +0000 Add label support in RemoteNickFormat diff --git a/bridge/config/config.go b/bridge/config/config.go index c5d4f54..09338f1 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -666 +667 @@ type Protocol struct {   IgnoreNicks string // all protocols   IgnoreMessages string // all protocols   Jid string // xmpp + Label string // all protocols   Login string // mattermost, matrix   MediaDownloadSize int // all protocols   MediaServerDownload string diff --git a/gateway/gateway.go b/gateway/gateway.go index 6fe7f0e..c70fbb0 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -3236 +3237 @@ func (gw *Gateway) modifyUsername(msg config.Message, dest *bridge.Bridge) strin   }   nick = strings.Replace(nick, "{BRIDGE}", br.Name, -1)   nick = strings.Replace(nick, "{PROTOCOL}", br.Protocol, -1) + nick = strings.Replace(nick, "{LABEL}", br.Config.Label, -1)   nick = strings.Replace(nick, "{NICK}", msg.Username, -1)   return nick  } diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index e0589fc..2f4d470 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -1179 +11714 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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  #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) @@ -2029 +20714 @@ ReplaceMessages=[ ["cat","dog"] ]  #OPTIONAL (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -2789 +28814 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}/{BRIDGE}] <{NICK}> " @@ -4149 +42914 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -4809 +50014 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -5376 +5627 @@ WebhookBindAddress="0.0.0.0:9999"  #Icon that will be showed in slack  #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  IconURL="https://robohash.org/{NICK}.png?size=48x48" @@ -5939 +61914 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -6839 +71414 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -7729 +80814 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -8629 +90314 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -9449 +99014 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -10209 +107114 @@ ReplaceMessages=[ ["cat","dog"] ]  #optional (default empty)  ReplaceNicks=[ ["user--","user"] ]   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> " @@ -10639 +111914 @@ Buffer=1000  #OPTIONAL (no authorization if token is empty)  Token="mytoken"   +#extra label that can be used in the RemoteNickFormat +#optional (default empty) +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)  RemoteNickFormat="{NICK}" @@ -10806 +11417 @@ RemoteNickFormat="{NICK}"  #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)  RemoteNickFormat="[{PROTOCOL}] <{NICK}> "