Strip IRC colors sent to XMPP
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user