summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-01-21 15:03:46 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-01-21 15:03:46 +0000
commit43951783f3185c6ae3d64f27f6f3462724dda689 (patch)
tree8283bb0c75393f5fb5f3e19e8fb4497ff580de37 /lib/rbot
parent6e8e503ede5f3a1a55826c94a87a6be9a5daed0e (diff)
Re-enable irc.ignore_users
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/ircbot.rb19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index ea3b2969..96947c5a 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -415,13 +415,20 @@ class IrcBot
# debug "Message target is #{data[:target].inspect}"
# debug "Bot is #{myself.inspect}"
- # TODO use the new Netmask class
- # @config['irc.ignore_users'].each { |mask| return if Irc.netmaskmatch(mask,m.source) }
+ ignored = false
+ @config['irc.ignore_users'].each { |mask|
+ if m.source.matches?(server.new_netmask(mask))
+ ignored = true
+ break
+ end
+ }
- irclogprivmsg(m)
+ unless ignored
+ irclogprivmsg(m)
- @plugins.delegate "listen", m
- @plugins.privmsg(m) if m.address?
+ @plugins.delegate "listen", m
+ @plugins.privmsg(m) if m.address?
+ end
}
@client[:notice] = proc { |data|
message = NoticeMessage.new(self, server, data[:source], data[:target], data[:message])
@@ -455,7 +462,7 @@ class IrcBot
debug "my nick is now #{new}"
end
data[:is_on].each { |ch|
- irclog "@ #{old} is now known as #{new}", ch
+ irclog "@ #{old} is now known as #{new}", ch
}
@plugins.delegate("listen", m)
@plugins.delegate("nick", m)