summaryrefslogtreecommitdiff
path: root/lib/rbot/messagemapper.rb
diff options
context:
space:
mode:
authorMatthias H <apoc@sixserv.org>2014-02-21 17:51:28 +0100
committerMatthias H <apoc@sixserv.org>2014-02-21 17:51:28 +0100
commitba5aaf073e5467b0b71adede32051f9b38c50a19 (patch)
treedef2d2ac2ffa0e6027188e6e01bf48d738926abb /lib/rbot/messagemapper.rb
parent8f23ec47bf539f8831719745e80c1bdaef966f6a (diff)
[webservice] control bot through http interface
Diffstat (limited to 'lib/rbot/messagemapper.rb')
-rw-r--r--lib/rbot/messagemapper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb
index d85f0b14..e154e395 100644
--- a/lib/rbot/messagemapper.rb
+++ b/lib/rbot/messagemapper.rb
@@ -258,7 +258,11 @@ class Bot
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}"
- if !m.in_thread && (tmpl.options[:thread] || tmpl.options[:threaded])
+ 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
+ # wait for the responses.
+
# since the message action is in a separate thread, the message may be
# delegated to unreplied() before the thread has a chance to actually
# mark it as replied. since threading is used mostly for commands that