summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-10-26 23:04:44 +0200
committerWim <wim@42.be>2017-10-26 23:04:44 +0200
commit299b71d98202b40365af063a886c7a2cf66582bc (patch)
tree4244a781224d42758bccf9a1477450270a75dafa
parent76aafe1fa81ea8d8339181042e72f07bcafcec58 (diff)
downloadmatterbridge-msglm-299b71d98202b40365af063a886c7a2cf66582bc.tar.gz
matterbridge-msglm-299b71d98202b40365af063a886c7a2cf66582bc.tar.bz2
matterbridge-msglm-299b71d98202b40365af063a886c7a2cf66582bc.zip
Strip irc colors correct, strip also ctrl chars (irc). Closes #286
-rw-r--r--bridge/irc/irc.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go
index 3276eab5..2c8c09a4 100644
--- a/bridge/irc/irc.go
+++ b/bridge/irc/irc.go
@@ -288,7 +288,9 @@ func (b *Birc) handlePrivMsg(event *irc.Event) {
}
msg += event.Message()
// strip IRC colors
- re := regexp.MustCompile(`[[:cntrl:]](\d+,|)\d+`)
+ re := regexp.MustCompile(`\x03(\d+,|)\d+`)
+ msg = re.ReplaceAllString(msg, "")
+ re = regexp.MustCompile(`[[:cntrl:]]`)
msg = re.ReplaceAllString(msg, "")
var r io.Reader