From 3ac610a592b8cc877edf10b7fcc7f55162a9136a Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 4 Apr 2007 10:04:57 +0000 Subject: New IRC Framework: use #reverse_each() instead of #each() when clearing the list of users and channels on a server, otherwise only half of the items get deleted --- lib/rbot/irc.rb | 4 ++-- lib/rbot/ircbot.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/rbot/irc.rb b/lib/rbot/irc.rb index 08ad5e69..45e14959 100644 --- a/lib/rbot/irc.rb +++ b/lib/rbot/irc.rb @@ -1456,10 +1456,10 @@ module Irc # Resets the Channel and User list # def reset_lists - @users.each { |u| + @users.reverse_each { |u| delete_user(u) } - @channels.each { |u| + @channels.reverse_each { |u| delete_channel(u) } end diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 4708724c..a22079bf 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -530,7 +530,7 @@ class Bot nickchg new # If we're setting our nick at connection because our choice was taken, # we have to fix our nick manually, because there will be no NICK message - # yo inform us that our nick has been changed. + # to inform us that our nick has been changed. if data[:target] == '*' debug "setting my connection nick to #{new}" nick = new -- cgit v1.2.3