split parseMessage into handleMessage
All checks were successful
irc build / Build (push) Successful in 1m43s
All checks were successful
irc build / Build (push) Successful in 1m43s
This commit is contained in:
parent
ceb1d3dd1a
commit
71eb2ed048
8
irc.go
8
irc.go
@ -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 := ""
|
||||
@ -292,8 +298,6 @@ func (c *Connection) parseMessage(line string) {
|
||||
//log.Printf("unhandled command: %s %s %s", cmd, target, msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Run runs the irc event loop
|
||||
func (c *Connection) Run() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user