diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index 6fc573bf..585151d7 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -4,6 +4,7 @@ import ( "crypto/tls" "strings" "time" + "regexp" "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" @@ -82,6 +83,10 @@ func (b *Bxmpp) Send(msg config.Message) (string, error) { } b.Log.Debugf("=> Receiving %#v", msg) + // Strip IRC colors sent to XMPP + re := regexp.MustCompile(`\x03(?:\d{1,2}(?:,\d{1,2})?)?|[[:cntrl:]]`) + msg.Text = re.ReplaceAllString(msg.Text, "") + // Upload a file (in xmpp case send the upload URL because xmpp has no native upload support) if msg.Extra != nil { for _, rmsg := range helper.HandleExtra(&msg, b.General) {