1
0
Fork 0
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:
Alex Bramley 2013-09-28 00:15:54 +01:00
parent 12eb9c89eb
commit 144001d109
5 changed files with 44 additions and 15 deletions

View file

@ -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()