diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-04-04 10:04:57 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-04-04 10:04:57 +0000 |
commit | 3ac610a592b8cc877edf10b7fcc7f55162a9136a (patch) | |
tree | 63578dd96279fa77d5c5bb7f2802a7537eb6fe66 | |
parent | a7b2718fb0ee7309fa73458b660112e046cf957e (diff) |
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
-rw-r--r-- | lib/rbot/irc.rb | 4 | ||||
-rw-r--r-- | lib/rbot/ircbot.rb | 2 |
2 files changed, 3 insertions, 3 deletions
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 |