X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fmessagemapper.rb;h=b6125538b49b1ba24be54ead551c42b9511181f6;hb=8115edef0169d95f0ebb64d77364e346e9452099;hp=b08a503feba4b858790f4f5908d7f9ce0ffde4ff;hpb=722a87ebc272bcccc4cf9c954251467a0f46e2e0;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb index b08a503f..b6125538 100644 --- a/lib/rbot/messagemapper.rb +++ b/lib/rbot/messagemapper.rb @@ -207,7 +207,7 @@ 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 tmpl.options[:thread] || tmpl.options[:threaded] + if !m.in_thread && (tmpl.options[:thread] || tmpl.options[:threaded]) Thread.new do begin @parent.send(action, m, options) @@ -519,7 +519,8 @@ class Bot # debug "Delimited optionals: #{rx.inspect}" rx.gsub!(/(?:\\ )+/, "\\s+") # debug "Corrected spaces: #{rx.inspect}" - @regexp = Regexp.new("^#{rx}$") + # Created message (such as by fake_message) can contain multiple lines + @regexp = /\A#{rx}\z/m end # Recognize the provided string components, returning a hash of