mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-28 13:42:01 -08:00
Add support for RemoteNickFormat in general configuration (samechannelgateway)
This commit is contained in:
parent
e1641b2c2e
commit
2e54b97fc2
@ -73,7 +73,10 @@ func (gw *SameChannelGateway) handleMessage(msg config.Message, dest *bridge.Bri
|
|||||||
|
|
||||||
func (gw *SameChannelGateway) modifyUsername(msg *config.Message, dest *bridge.Bridge) {
|
func (gw *SameChannelGateway) modifyUsername(msg *config.Message, dest *bridge.Bridge) {
|
||||||
br := gw.Bridges[msg.Account]
|
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, "{NICK}", msg.Username, -1)
|
||||||
nick = strings.Replace(nick, "{BRIDGE}", br.Name, -1)
|
nick = strings.Replace(nick, "{BRIDGE}", br.Name, -1)
|
||||||
nick = strings.Replace(nick, "{PROTOCOL}", br.Protocol, -1)
|
nick = strings.Replace(nick, "{PROTOCOL}", br.Protocol, -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user