Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 295f787b793c4a9d6933aced546eae05ec4ffcc8 Author: John <7192933+qtaf@users.noreply.github.com> Date: Wed Jul 11 16:50:49 2018 +0000 Stop numbers being stripped after non-color control codes (irc) (#465) Currently numbers are stripped not just after the color control code (\x03) but also after other formatting such as bold (\x02) and italic (\x1D), which is both unnecessary and leads to missing text from irc. This fixes that by only stripping numbers after the color control code. diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index fe1e0d3..5b1d74e 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -3977 +3977 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) {   rmsg.Text += event.StripAction()     // strip IRC colors - re := regexp.MustCompile(`[[:cntrl:]](?:\d{1,2}(?:,\d{1,2})?)?`) + re := regexp.MustCompile(`\x03(?:\d{1,2}(?:,\d{1,2})?)?|[[:cntrl:]]`)   rmsg.Text = re.ReplaceAllString(rmsg.Text, "")     // start detecting the charset