]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
auth module: update for messagemapper changes
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 8 Dec 2010 09:47:26 +0000 (10:47 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 8 Dec 2010 09:47:26 +0000 (10:47 +0100)
Since commit a993d1c358e24ab85621568c10411c5496e2dea8, the message
mappers have a more rational way of reporting failures, but the auth
module was not using it, resulting in the wrong permissions being
granted/revoked whenever allow/deny was being used.

lib/rbot/core/auth.rb

index c156ce1a37495494993474397a8fd79520c5a5ca..30f99ecf20171183ca826a5b4d1a3895f31ce5ca 100644 (file)
@@ -220,8 +220,8 @@ class AuthModule < CoreBotModule
     auth = nil
     if cmds.has_key?(k)
       cmds[k][:botmodule].handler.each do |tmpl|
-        options, failure = tmpl.recognize(pseudo)
-        next if options.nil?
+        options = tmpl.recognize(pseudo)
+        next if options.kind_of? MessageMapper::Failure
         auth = tmpl.options[:full_auth_path]
         break
       end