]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/messagemapper.rb
ircbot: sendmsg filtering
[user/henk/code/ruby/rbot.git] / lib / rbot / messagemapper.rb
index b97253a1d388d3d96c5e382fe4879fc1856625ad..b6125538b49b1ba24be54ead551c42b9511181f6 100644 (file)
@@ -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 m.thread || (m.thread.nil? && 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