summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--data/rbot/plugins/math.rb4
-rw-r--r--lib/rbot/auth.rb2
-rw-r--r--lib/rbot/messagemapper.rb9
4 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 71e4b6e5..6ddfed99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Aug 12 20:51:38 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
+
+ * fix up autoop plugin a bit
+
Thu Aug 11 00:13:11 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* Added two plugins from Robin Kearney <robin@riviera.org.uk>
diff --git a/data/rbot/plugins/math.rb b/data/rbot/plugins/math.rb
index 4a207389..09e3ed3f 100644
--- a/data/rbot/plugins/math.rb
+++ b/data/rbot/plugins/math.rb
@@ -22,6 +22,9 @@ class MathPlugin < Plugin
"ten" => "10"
};
+ def name
+ "math"
+ end
def help(plugin, topic="")
"math <expression>, evaluate mathematical expression"
end
@@ -120,3 +123,4 @@ class MathPlugin < Plugin
end
plugin = MathPlugin.new
plugin.register("math")
+plugin.register("maths")
diff --git a/lib/rbot/auth.rb b/lib/rbot/auth.rb
index cc11a5a2..16f092a5 100644
--- a/lib/rbot/auth.rb
+++ b/lib/rbot/auth.rb
@@ -6,7 +6,7 @@ module Irc
# match *!*@baz.com, foo!*@*, *!bar@*, etc.
def Irc.netmaskmatch(globmask, netmask)
regmask = globmask.gsub(/\*/, ".*?")
- return true if(netmask =~ /#{regmask}/)
+ return true if(netmask =~ /#{regmask}/i)
return false
end
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb
index b079acd6..ce33c881 100644
--- a/lib/rbot/messagemapper.rb
+++ b/lib/rbot/messagemapper.rb
@@ -121,7 +121,10 @@ module Irc
failures << [tmpl, failure]
else
action = tmpl.options[:action] ? tmpl.options[:action] : tmpl.items[0]
- next unless @parent.respond_to?(action)
+ unless @parent.respond_to?(action)
+ failures << [tmpl, "class does not respond to action #{action}"]
+ next
+ end
auth = tmpl.options[:auth] ? tmpl.options[:auth] : tmpl.items[0]
debug "checking auth for #{auth}"
if m.bot.auth.allow?(auth, m.source, m.replyto)
@@ -135,7 +138,9 @@ module Irc
return false
end
end
- debug failures.inspect
+ failures.each {|f, r|
+ debug "#{f.inspect} => #{r}"
+ }
debug "no handler found, trying fallback"
if @fallback != nil && @parent.respond_to?(@fallback)
if m.bot.auth.allow?(@fallback, m.source, m.replyto)