X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fmessagemapper.rb;h=d85f0b14aa69e448bfdddff2e2193e594a71cea4;hb=c32c3ef9180dcf4dc22829f1795b666da06008bf;hp=ca076e4ac2310506e9d171e32e31665e97424018;hpb=a993d1c358e24ab85621568c10411c5496e2dea8;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb index ca076e4a..d85f0b14 100644 --- a/lib/rbot/messagemapper.rb +++ b/lib/rbot/messagemapper.rb @@ -259,6 +259,12 @@ class Bot 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]) + # 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) @@ -384,7 +390,7 @@ class Bot mul = multi? ? " multi" : " single" opt = optional? ? " optional" : " needed" if @regexp - reg = " regexp=%s index=%d" % [@regexp, @index] + reg = " regexp=%s index=%s" % [@regexp, @index] else reg = nil end