]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
New unreplied() method for plugins that want to handle PRIVMSGs unreplied by any...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 15 Feb 2007 13:58:15 +0000 (13:58 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 15 Feb 2007 13:58:15 +0000 (13:58 +0000)
ChangeLog
data/rbot/plugins/keywords.rb
lib/rbot/ircbot.rb
lib/rbot/plugins.rb

index 5d3a72582ce2a9848c585faea94674e66facd611..4655e5ed669dbce9543e9bb0c2a382467be19099 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-15  Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
+
+       * Plugin: new unreplied() method to handle PRIVMSGs which have not
+       been replied to.
+
 2007-02-12  Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
 
        * Remote Service Provider: from an idea by halorgium <rbot@spork.in>,
index 0c1b35262ca693c1e265b468294f528116bc201e..855bfe6aa4e25bb4472ed839be7621a923fde5b1 100644 (file)
@@ -489,8 +489,8 @@ class Keywords < Plugin
     end
   end
 
-  def listen(m)
-    return if m.address?
+  def unreplied(m)
+    return if m.address?
     # in channel message, not to me
     # TODO option to do if(m.message =~ /^(.*)$/, ie try any line as a
     # keyword lookup.
index ed435fb407c700ea61a817e37362cb0349a71c19..0ef6b1ded83c0efa31cfd453df96d46716a59917 100644 (file)
@@ -498,6 +498,9 @@ class IrcBot
       unless ignored
         @plugins.delegate "listen", m
         @plugins.privmsg(m) if m.address?
+       if not m.replied
+          @plugins.delegate "unreplied", m
+        end
       end
     }
     @client[:notice] = proc { |data|
index 564495e0c5d89beaba2566e68ce59cfb2974b335..e101e627772d0cf977689f9b5173216abacd84b7 100644 (file)
@@ -61,11 +61,14 @@ module Plugins
                          etc.
 
   privmsg(PrivMessage)::
-                         called for a PRIVMSG if the first word matches one
+                         Called for a PRIVMSG if the first word matches one
                          the plugin register()d for. Use m.plugin to get
                          that word and m.params for the rest of the message,
                          if applicable.
 
+  unreplied(PrivMessage)::
+                         Called for a PRIVMSG which has not been replied to.
+
   kick(KickMessage)::
                          Called when a user (or the bot) is kicked from a
                          channel the bot is in.