summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-20 21:52:53 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-20 21:52:53 +0000
commit6729561592ffd9630fb8e53509cde9d5e12c9126 (patch)
tree74068e40bc1fcf5c05b9fd708d8091c750a46716
parentd7eaab117525872980bed0af1ffafc11516ea8d6 (diff)
Apply patch offered in #98
-rw-r--r--lib/rbot/ircbot.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index eafa21c9..6d76cc49 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -147,6 +147,9 @@ class IrcBot
BotConfig.register BotConfigArrayValue.new('irc.join_channels',
:default => [], :wizard => true,
:desc => "What channels the bot should always join at startup. List multiple channels using commas to separate. If a channel requires a password, use a space after the channel name. e.g: '#chan1, #chan2, #secretchan secritpass, #chan3'")
+ BotConfig.register BotConfigArrayValue.new('irc.ignore_users',
+ :default => [],
+ :desc => "Which users to ignore input from. This is mainly to avoid bot-wars triggered by creative people")
BotConfig.register BotConfigIntegerValue.new('core.save_every',
:default => 60, :validate => Proc.new{|v| v >= 0},
@@ -815,6 +818,8 @@ class IrcBot
end
end
+ @config['irc.ignore_users'].each { |mask| return if Irc.netmaskmatch(mask,m.source) }
+
# pass it off to plugins that want to hear everything
@plugins.delegate "listen", m