This commit is contained in:
Andrew 2019-05-04 10:01:18 +10:00
parent edcbd2035a
commit e1e4e900f8

@ -178,9 +178,9 @@ func (sc *ServerConnection) ProcessIncomingLine(line string) {
// IRC commands are case-insensitive // IRC commands are case-insensitive
sc.dispatchIn(strings.ToUpper(cmd), info) sc.dispatchIn(strings.ToUpper(cmd), info)
if strings.ToUpper(cmd) == "PRIVMSG" { if strings.ToUpper(cmd) == "PRIVMSG" {
sc.dispatchBasicCmd(info) sc.dispatchBasicCmd(info)
} }
} }
@ -281,14 +281,14 @@ func (sc *ServerConnection) Send(tags map[string]string, prefix string, command
// dispatchCommand dispatches an event based on simple commands (e.g !help) // dispatchCommand dispatches an event based on simple commands (e.g !help)
func (sc *ServerConnection) dispatchBasicCmd(info eventmgr.InfoMap) { func (sc *ServerConnection) dispatchBasicCmd(info eventmgr.InfoMap) {
cmd := info["params"].([]string) cmd := info["params"].([]string)
pfx := cmd[1][0] pfx := cmd[1][0]
for _, p := range basicCmdPrefixes { for _, p := range basicCmdPrefixes {
if pfx == p { if pfx == p {
sc.eventsIn.Dispatch("cmd"+cmd[1], info) sc.eventsIn.Dispatch("cmd"+cmd[1], info)
} }
} }
} }
// dispatchRawIn dispatches raw inbound messages. // dispatchRawIn dispatches raw inbound messages.