From f7ed9e53fa59c97c503b0ed1abe1eb288f4575eb Mon Sep 17 00:00:00 2001 From: chotaire Date: Wed, 17 Apr 2019 00:22:07 +0200 Subject: [PATCH] Remove IRC color stripping and regexp import --- bridge/irc/handlers.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bridge/irc/handlers.go b/bridge/irc/handlers.go index 1d260071..47a0e933 100644 --- a/bridge/irc/handlers.go +++ b/bridge/irc/handlers.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "io/ioutil" - "regexp" "strconv" "strings" "time" @@ -177,10 +176,6 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) { // strip action, we made an event if it was an action rmsg.Text += event.StripAction() - // strip IRC colors - re := regexp.MustCompile(`\x03(?:\d{1,2}(?:,\d{1,2})?)?|[[:cntrl:]]`) - rmsg.Text = re.ReplaceAllString(rmsg.Text, "") - // start detecting the charset mycharset := b.GetString("Charset") if mycharset == "" { @@ -235,4 +230,4 @@ func (b *Birc) handleTopicWhoTime(client *girc.Client, event girc.Event) { user += " [" + parts[1] + "]" } b.Log.Debugf("%s: Topic set by %s [%s]", event.Command, user, time.Unix(t, 0)) -} +} \ No newline at end of file