# Skip this element if it was unmapped
next unless tmpl
botmodule = @parent.plugins[tmpl.botmodule]
- options, failure = tmpl.recognize(m)
- if options.nil?
- failures << [tmpl, failure]
+ options = tmpl.recognize(m)
+ if options.kind_of? Failure
+ failures << options
else
action = tmpl.options[:action]
unless botmodule.respond_to?(action)
- failures << [tmpl, "#{botmodule} does not respond to action #{action}"]
+ failures << NoActionFailure.new(tmpl, m)
next
end
auth = tmpl.options[:full_auth_path]
debug "checking auth for #{auth}"
# We check for private permission
- if m.bot.auth.allow?(auth, m.source, '?')
+ if m.bot.auth.permit?(m.source, auth, '?')
debug "template match found and auth'd: #{action.inspect} #{options.inspect}"
return :return => botmodule.send(action, m, options)
end
return false
end
end
- failures.each {|f, r|
- debug "#{f.inspect} => #{r}"
+ failures.each {|r|
+ debug "#{r.template.inspect} => #{r}"
}
debug "no handler found"
return false
include RemoteCoreBotModule
Config.register Config::BooleanValue.new('remote.autostart',
- :default => true,
+ :default => false,
:requires_rescan => true,
:desc => "Whether the remote service provider should be started automatically")