event: Fixed all CTCP events being parsed as ctcp-reply kind.

This commit is contained in:
2018-11-25 18:29:37 +01:00
parent 15a51e0151
commit 2dd72f9838
+6 -6
View File
@@ -77,18 +77,18 @@ func ParsePacket(line string) (Event, error) {
if (event.verb == "PRIVMSG" || event.verb == "NOTICE") && strings.HasPrefix(event.Text, "\x01") {
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]
if len(verbtext) == 2 {
event.Text = verbtext[1]
} else {
event.Text = ""
}
if event.verb == "PRIVMSG" {
event.kind = "ctcp"
} else {
event.kind = "ctcp-reply"
}
}
event.name = event.kind + "." + strings.ToLower(event.verb)