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)
|
c.NumericCallback(c, from, code, args)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
c.handleMessage(args, cmd, from)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Connection) handleMessage(args, cmd, from string) {
|
||||||
t := strings.SplitN(args, ":", 2)
|
t := strings.SplitN(args, ":", 2)
|
||||||
target := strings.TrimSpace(t[0])
|
target := strings.TrimSpace(t[0])
|
||||||
msg := ""
|
msg := ""
|
||||||
@ -291,8 +297,6 @@ func (c *Connection) parseMessage(line string) {
|
|||||||
default:
|
default:
|
||||||
//log.Printf("unhandled command: %s %s %s", cmd, target, msg)
|
//log.Printf("unhandled command: %s %s %s", cmd, target, msg)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run runs the irc event loop
|
// Run runs the irc event loop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user