mirror of
https://github.com/fluffle/goirc
synced 2025-05-12 10:41:42 +00:00
Split handlers up into three groups.
This commit is contained in:
parent
12eb9c89eb
commit
144001d109
5 changed files with 44 additions and 15 deletions
|
@ -22,7 +22,9 @@ type Conn struct {
|
|||
cfg *Config
|
||||
|
||||
// Handlers
|
||||
handlers *hSet
|
||||
intHandlers *hSet
|
||||
fgHandlers *hSet
|
||||
bgHandlers *hSet
|
||||
|
||||
// State tracker for nicks and channels
|
||||
st state.Tracker
|
||||
|
@ -116,12 +118,14 @@ func Client(cfg *Config) *Conn {
|
|||
cfg.Me.Name = "Powered by GoIRC"
|
||||
}
|
||||
conn := &Conn{
|
||||
cfg: cfg,
|
||||
in: make(chan *Line, 32),
|
||||
out: make(chan string, 32),
|
||||
handlers: handlerSet(),
|
||||
stRemovers: make([]Remover, 0, len(stHandlers)),
|
||||
lastsent: time.Now(),
|
||||
cfg: cfg,
|
||||
in: make(chan *Line, 32),
|
||||
out: make(chan string, 32),
|
||||
intHandlers: handlerSet(),
|
||||
fgHandlers: handlerSet(),
|
||||
bgHandlers: handlerSet(),
|
||||
stRemovers: make([]Remover, 0, len(stHandlers)),
|
||||
lastsent: time.Now(),
|
||||
}
|
||||
conn.addIntHandlers()
|
||||
conn.initialise()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue