summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias H <apoc@sixserv.org>2015-01-12 11:03:20 +0100
committerMatthias H <apoc@sixserv.org>2015-01-12 11:03:20 +0100
commitf9b3074dac517b8c82b5affa8bb53c29b6c43e2e (patch)
treed34a5f96a013b9a02b0dec9d63112fced1f7c96a /lib
parent4db74a4964d8438f1c72a07e2d25600b571540c5 (diff)
messagemapper: refactor options are really the params
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/messagemapper.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb
index e154e395..3e877626 100644
--- a/lib/rbot/messagemapper.rb
+++ b/lib/rbot/messagemapper.rb
@@ -245,9 +245,9 @@ class Bot
return false if @templates.empty?
failures = []
@templates.each do |tmpl|
- options = tmpl.recognize(m)
- if options.kind_of? Failure
- failures << options
+ params = tmpl.recognize(m)
+ if params.kind_of? Failure
+ failures << params
else
action = tmpl.options[:action]
unless @parent.respond_to?(action)
@@ -257,7 +257,7 @@ class Bot
auth = tmpl.options[:full_auth_path]
debug "checking auth for #{auth}"
if m.bot.auth.allow?(auth, m.source, m.replyto)
- debug "template match found and auth'd: #{action.inspect} #{options.inspect}"
+ debug "template match found and auth'd: #{action.inspect} #{params.inspect}"
if !m.in_thread and (tmpl.options[:thread] or tmpl.options[:threaded]) and
(defined? WebServiceUser and not m.source.instance_of? WebServiceUser)
# Web service: requests are handled threaded anyway and we want to
@@ -271,14 +271,14 @@ class Bot
m.replied = true
Thread.new do
begin
- @parent.send(action, m, options)
+ @parent.send(action, m, params)
rescue Exception => e
error "In threaded action: #{e.message}"
debug e.backtrace.join("\n")
end
end
else
- @parent.send(action, m, options)
+ @parent.send(action, m, params)
end
return true