split parseMessage into handleMessage
All checks were successful
irc build / Build (push) Successful in 1m43s

This commit is contained in:
blackbeard420 2025-03-06 22:42:15 -05:00
parent ceb1d3dd1a
commit 71eb2ed048

8
irc.go
View File

@ -247,6 +247,12 @@ func (c *Connection) parseMessage(line string) {
c.NumericCallback(c, from, code, args)
}
} else {
c.handleMessage(args, cmd, from)
}
}
}
func (c *Connection) handleMessage(args, cmd, from string) {
t := strings.SplitN(args, ":", 2)
target := strings.TrimSpace(t[0])
msg := ""
@ -291,8 +297,6 @@ func (c *Connection) parseMessage(line string) {
default:
//log.Printf("unhandled command: %s %s %s", cmd, target, msg)
}
}
}
}
// Run runs the irc event loop