]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/keywords.rb
bans plugin: fix badword regular expression creation
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / keywords.rb
index 0c1b35262ca693c1e265b468294f528116bc201e..255d7fe6886a2c56fcc6bd90f021a65cf23cc181 100644 (file)
@@ -489,12 +489,10 @@ class Keywords < Plugin
     end
   end
 
-  def listen(m)
-    return if m.address?
-    # in channel message, not to me
+  def unreplied(m)
     # TODO option to do if(m.message =~ /^(.*)$/, ie try any line as a
     # keyword lookup.
-    if !@bot.config["keyword.address"] && m.message =~ /^(.*\S)\s*\?\s*$/
+    if m.message =~ /^(.*\S)\s*\?\s*$/ and (m.address? or not @bot.config["keyword.address"])
       keyword_lookup m, $1, true if @bot.auth.allow?("keyword", m.source)
     elsif @bot.config["keyword.listen"] && (m.message =~ /^(.*?)\s+(is|are)\s+(.*)$/)
       # TODO MUCH more selective on what's allowed here