diff options
author | dmitry kim <jason@nichego.net> | 2008-06-18 14:39:15 +0400 |
---|---|---|
committer | dmitry kim <jason@nichego.net> | 2008-06-18 14:39:27 +0400 |
commit | b74f6944594ec5e998bb023a4bb6184794d02298 (patch) | |
tree | 79f5fd755df8ddae85c1d474e77c1ce14fba94e1 /lib/rbot | |
parent | 86edc6b2367b3845df004d7ac5975f566bfbebfe (diff) |
* ircbot: fix quiet/reset_quiet wrt missing args
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/ircbot.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 65f3edf6..33def8bc 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -558,7 +558,7 @@ class Bot # Array of channels names where the bot should be quiet # '*' means all channels # - @quiet = [] + @quiet = Set.new @client[:welcome] = proc {|data| m = WelcomeMessage.new(self, server, data[:source], data[:target], data[:message]) @@ -753,17 +753,17 @@ class Bot return @quiet.include?('*') || @quiet.include?(channel.downcase) end - def set_quiet(channel) + def set_quiet(channel = nil) if channel ch = channel.downcase.dup - @quiet << ch unless @quiet.include?(ch) + @quiet << ch else @quiet.clear @quiet << '*' end end - def reset_quiet(channel) + def reset_quiet(channel = nil) if channel @quiet.delete channel.downcase else |