Add support for RemoteNickFormat in general configuration

pull/93/head
Wim 8 years ago
parent e0e1e4be80
commit e1641b2c2e

@ -80,6 +80,7 @@ type Config struct {
Xmpp map[string]Protocol
Discord map[string]Protocol
Telegram map[string]Protocol
General Protocol
Gateway []Gateway
SameChannelGateway []SameChannelGateway
}

@ -178,7 +178,10 @@ func (gw *Gateway) modifyMessage(msg *config.Message, dest *bridge.Bridge) {
func (gw *Gateway) modifyUsername(msg *config.Message, dest *bridge.Bridge) {
br := gw.Bridges[msg.Account]
nick := dest.Config.RemoteNickFormat
nick := gw.Config.General.RemoteNickFormat
if nick == "" {
nick = dest.Config.RemoteNickFormat
}
nick = strings.Replace(nick, "{NICK}", msg.Username, -1)
nick = strings.Replace(nick, "{BRIDGE}", br.Name, -1)
nick = strings.Replace(nick, "{PROTOCOL}", br.Protocol, -1)

@ -371,6 +371,19 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
#OPTIONAL (default false)
ShowJoinPart=false
###################################################################
#General configuration
###################################################################
#Settings here override specific settings for each protocol
[general]
#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 "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge
#OPTIONAL (default empty)
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
###################################################################
#Gateway configuration

Loading…
Cancel
Save