]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/message.rb
Merge branch 'master' of ssh://ruby-rbot.org/var/git/rbot
[user/henk/code/ruby/rbot.git] / lib / rbot / message.rb
index 47994c10735d4e5a01ab8ae2fdc4aad1b49ae6b8..35100802b8d640db409b90d876fc54a2ed147900 100644 (file)
@@ -287,6 +287,7 @@ module Irc
         @message = $3 || String.new
         @action = @ctcp == 'ACTION'
         debug "Received CTCP command #{@ctcp} with options #{@message} (action? #{@action})"
+        @logmessage = @message.dup
       end
 
       # free splitting for plugins
@@ -333,7 +334,7 @@ module Irc
     # the nick or core.reply_with_nick is set to false
     #
     def reply(string, options={})
-      if @bot.config['core.reply_with_nick'] and not string =~ /\b#{@source}\b/
+      if @bot.config['core.reply_with_nick'] and not string =~ /\b#{Regexp.escape(@source.to_s)}\b/
         return nickreply(string, options)
       end
       plainreply(string, options)
@@ -381,6 +382,12 @@ module Irc
       plainokay
     end
 
+    # send a NOTICE to the message source
+    #
+    def notify(msg,opts={})
+      @bot.notice(sourcenick, msg, opts)
+    end
+
   end
 
   # class to manage IRC PRIVMSGs