cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Channel list update on reconnect #129

Closed Audio closed 11 years ago

Audio commented 11 years ago

Observed behaviour: list of joined channels remains unchanged after network connection to a server is lost.

Lets have a very simple bot that replies with all active channel names on channels message.

bot = Cinch::Bot.new do
  configure do |c|
    c.server = "irc.rizon.net"
    c.channels = ["#abraka"]
  end

  on :message, "channels" do |m|
    m.reply "Active channels: #{@bot.channels.join(', ')}"
  end
end

Now, lets assume that the network connection is lost for a few minutes, so server disconnects the bot because of ping timeout. After then, the bot automatically rejoins, but he's twice on this channel.

[21:37] Pohroma: channels
[21:37] cinch: Active channels: #abraka, #abraka

Tested in both real environment and simulation with ifdown eth0 and ifup eth0.

Anyway, thanks for this awesome framework! @Frca, @Tasssadar, @Audio

dominikh commented 11 years ago

Yeah, we should clear the list of channels on connect.

Audio commented 11 years ago

Thanks!