]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/messagemapper.rb
geoip plugin: added nick based network-wide lookup and fixed some charset issues
[user/henk/code/ruby/rbot.git] / lib / rbot / messagemapper.rb
index 2b9fc5e32c2a99238a79c53b469d927b9e9804b2..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