5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-14 03:50:26 +00:00

Fix irc ACTION regression (irc). Closes #306

This commit is contained in:
Wim 2017-12-07 22:07:45 +01:00
parent 1b89604c7a
commit 3496ed0c7e

View File

@ -327,11 +327,10 @@ func (b *Birc) handlePrivMsg(client *girc.Client, event girc.Event) {
rmsg := config.Message{Username: event.Source.Name, Channel: event.Params[0], Account: b.Account, UserID: event.Source.Ident + "@" + event.Source.Host} rmsg := config.Message{Username: event.Source.Name, Channel: event.Params[0], Account: b.Account, UserID: event.Source.Ident + "@" + event.Source.Host}
flog.Debugf("handlePrivMsg() %s %s %#v", event.Source.Name, event.Trailing, event) flog.Debugf("handlePrivMsg() %s %s %#v", event.Source.Name, event.Trailing, event)
msg := "" msg := ""
if event.Command == "CTCP_ACTION" { if event.IsAction() {
// msg = event.Source.Name + " "
rmsg.Event = config.EVENT_USER_ACTION rmsg.Event = config.EVENT_USER_ACTION
} }
msg += event.Trailing msg += event.StripAction()
// strip IRC colors // strip IRC colors
re := regexp.MustCompile(`[[:cntrl:]](?:\d{1,2}(?:,\d{1,2})?)?`) re := regexp.MustCompile(`[[:cntrl:]](?:\d{1,2}(?:,\d{1,2})?)?`)
msg = re.ReplaceAllString(msg, "") msg = re.ReplaceAllString(msg, "")