Add support for RemoteNickFormat in general configuration (samechannelgateway)

This commit is contained in:
Wim 2016-11-20 23:50:12 +01:00
parent e1641b2c2e
commit 2e54b97fc2
1 changed files with 4 additions and 1 deletions

View File

@ -73,7 +73,10 @@ func (gw *SameChannelGateway) handleMessage(msg config.Message, dest *bridge.Bri
func (gw *SameChannelGateway) 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)