X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fmessagemapper.rb;h=e154e3952c406f42eb9178f5c9a99a43ee4fc227;hb=d935d59d0430c40c9e51664693c370563d5d09cb;hp=c222ee71350066e943c25a65f94cf5f745a04b50;hpb=0b95114018f49dde6078e88935db54b2c8f20dd5;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb index c222ee71..e154e395 100644 --- a/lib/rbot/messagemapper.rb +++ b/lib/rbot/messagemapper.rb @@ -258,7 +258,17 @@ 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 + # are known to take some processing time (e.g. download a web page) before + # giving an output, we just mark these as 'replied' here + m.replied = true Thread.new do begin @parent.send(action, m, options)