|
@ -29,7 +29,7 @@ type Channel struct { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func newChannel(parent *Bot, name string, client *irc.Client) *Channel { |
|
|
func newChannel(parent *Bot, name string, client *irc.Client) *Channel { |
|
|
ctx, cancel := context.WithCancel(context.Background()) |
|
|
|
|
|
|
|
|
ctx, cancel := context.WithCancel(parent.ctx) |
|
|
|
|
|
|
|
|
return &Channel{ |
|
|
return &Channel{ |
|
|
name: name, |
|
|
name: name, |
|
@ -266,7 +266,7 @@ func (channel *Channel) loop() { |
|
|
channel.lastPostSessionID = "" |
|
|
channel.lastPostSessionID = "" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
case <-channel.parentCtx.Done(): |
|
|
|
|
|
|
|
|
case <-channel.ctx.Done(): |
|
|
{ |
|
|
{ |
|
|
// Time to pack up shop.
|
|
|
// Time to pack up shop.
|
|
|
return |
|
|
return |
|
|