Merge pull request #40 from oniichaNj/master

no longer breaks on invalid (too short) ctcp requests
This commit is contained in:
Thomas Jager 2014-08-06 09:09:35 +02:00
commit 40cfe292a9

View File

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