summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/ircbot.rb8
-rw-r--r--lib/rbot/message.rb5
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index f1a56792..9afdc46c 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -566,19 +566,15 @@ class Bot
# debug "Message target is #{data[:target].inspect}"
# debug "Bot is #{myself.inspect}"
- ignored = false
@config['irc.ignore_users'].each { |mask|
if m.source.matches?(server.new_netmask(mask))
- ignored = true
- break
+ m.ignored = true
end
}
irclogprivmsg(m)
- unless ignored
- @plugins.irc_delegate('privmsg', m)
- end
+ @plugins.irc_delegate('privmsg', m) unless m.ignored?
}
@client[:notice] = proc { |data|
message = NoticeMessage.new(self, server, data[:source], data[:target], data[:message])
diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb
index aa825e13..bd3f85f1 100644
--- a/lib/rbot/message.rb
+++ b/lib/rbot/message.rb
@@ -128,6 +128,10 @@ module Irc
# has the message been replied to/handled by a plugin?
attr_accessor :replied
+ # should the message be ignored?
+ attr_accessor :ignored
+ alias :ignored? :ignored
+
# instantiate a new Message
# bot:: associated bot class
# server:: Server where the message took place
@@ -145,6 +149,7 @@ module Irc
@message = BasicUserMessage.stripcolour message
@replied = false
@server = server
+ @ignored = false
@identified = false
if @msg_wants_id && @server.capabilities[:"identify-msg"]