|
@ -77,18 +77,18 @@ func ParsePacket(line string) (Event, error) { |
|
|
if (event.verb == "PRIVMSG" || event.verb == "NOTICE") && strings.HasPrefix(event.Text, "\x01") { |
|
|
if (event.verb == "PRIVMSG" || event.verb == "NOTICE") && strings.HasPrefix(event.Text, "\x01") { |
|
|
verbtext := strings.SplitN(strings.Replace(event.Text, "\x01", "", 2), " ", 2) |
|
|
verbtext := strings.SplitN(strings.Replace(event.Text, "\x01", "", 2), " ", 2) |
|
|
|
|
|
|
|
|
|
|
|
if event.verb == "PRIVMSG" { |
|
|
|
|
|
event.kind = "ctcp" |
|
|
|
|
|
} else { |
|
|
|
|
|
event.kind = "ctcp-reply" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
event.verb = verbtext[0] |
|
|
event.verb = verbtext[0] |
|
|
if len(verbtext) == 2 { |
|
|
if len(verbtext) == 2 { |
|
|
event.Text = verbtext[1] |
|
|
event.Text = verbtext[1] |
|
|
} else { |
|
|
} else { |
|
|
event.Text = "" |
|
|
event.Text = "" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if event.verb == "PRIVMSG" { |
|
|
|
|
|
event.kind = "ctcp" |
|
|
|
|
|
} else { |
|
|
|
|
|
event.kind = "ctcp-reply" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
event.name = event.kind + "." + strings.ToLower(event.verb) |
|
|
event.name = event.kind + "." + strings.ToLower(event.verb) |
|
|