4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 16:39:24 +00:00

Move nickformatting into bridge

This commit is contained in:
Wim
2016-08-16 00:08:38 +02:00
parent 889b6debc4
commit e11d786775
4 changed files with 31 additions and 25 deletions

View File

@ -59,11 +59,7 @@ func (b *Bxmpp) Name() string {
}
func (b *Bxmpp) Send(msg config.Message) error {
username := msg.Username + ": "
if b.Config.Xmpp.RemoteNickFormat != "" {
username = strings.Replace(b.Config.Xmpp.RemoteNickFormat, "{NICK}", msg.Username, -1)
}
b.xc.Send(xmpp.Chat{Type: "groupchat", Remote: msg.Channel + "@" + b.Xmpp.Muc, Text: username + msg.Text})
b.xc.Send(xmpp.Chat{Type: "groupchat", Remote: msg.Channel + "@" + b.Xmpp.Muc, Text: msg.Username + msg.Text})
return nil
}
@ -126,7 +122,7 @@ func (b *Bxmpp) handleXmpp() error {
nick = s[1]
}
if nick != b.Xmpp.Nick {
flog.xmpp.Info("sending message to remote", nick, v.Text, channel)
flog.xmpp.Infof("sending message to remote %s %s %s", nick, v.Text, channel)
b.Remote <- config.Message{Username: nick, Text: v.Text, Channel: channel, Origin: "xmpp"}
}
}