diff options
Diffstat (limited to '')
-rw-r--r-- | irc/typing.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/irc/typing.go b/irc/typing.go index a62a420..28fb223 100644 --- a/irc/typing.go +++ b/irc/typing.go @@ -24,8 +24,7 @@ func NewTypings() *Typings { stops: make(chan Typing, 16), } go func() { - for { - t := <-ts.timeouts + for t := range ts.timeouts { now := time.Now() ts.l.Lock() oldT, ok := ts.targets[t] @@ -41,6 +40,11 @@ func NewTypings() *Typings { return ts } +func (ts *Typings) Stop() { + close(ts.timeouts) + close(ts.stops) +} + func (ts *Typings) Stops() <-chan Typing { return ts.stops } |