mirror of
https://github.com/gissleh/irc.git
synced 2026-09-29 00:05:34 +00:00
event: Fixed all CTCP events being parsed as ctcp-reply kind.
This commit is contained in:
+6
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user