no longer breaks on invalid ctcp requests

This commit is contained in:
Dumb Thing 2014-08-06 00:27:45 +02:00
parent 33fb824b4f
commit d088b73396

View File

@ -90,7 +90,7 @@ func (irc *Connection) RunCallbacks(event *Event) {
} else if msg == "TIME" { } else if msg == "TIME" {
event.Code = "CTCP_TIME" event.Code = "CTCP_TIME"
} else if msg[0:4] == "PING" { } else if strings.HasPrefix(msg, "PING") {
event.Code = "CTCP_PING" event.Code = "CTCP_PING"
} else if msg == "USERINFO" { } else if msg == "USERINFO" {
@ -99,10 +99,11 @@ func (irc *Connection) RunCallbacks(event *Event) {
} else if msg == "CLIENTINFO" { } else if msg == "CLIENTINFO" {
event.Code = "CTCP_CLIENTINFO" event.Code = "CTCP_CLIENTINFO"
} else if msg[0:6] == "ACTION" { } else if strings.HasPrefix(msg, "ACTION") {
event.Code = "CTCP_ACTION" event.Code = "CTCP_ACTION"
msg = msg[7:] msg = msg[7:]
} }
event.Arguments[len(event.Arguments)-1] = msg event.Arguments[len(event.Arguments)-1] = msg
} }