From 8b0e2e09f81a7d89ceb52e947e9db12a206a8c37 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Thu, 13 Oct 2005 15:37:44 +0000 Subject: various outstanding changes --- data/rbot/plugins/markov.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'data/rbot/plugins/markov.rb') diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index 6c51af51..e06753fa 100644 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -50,7 +50,10 @@ class MarkovPlugin < Plugin end def ignore?(user=nil) - return @registry['ignore_users'].include?(user) + @registry['ignore_users'].each do |mask| + return true if Irc.netmaskmatch mask, user + end + return false end def ignore(m, params) @@ -154,7 +157,7 @@ class MarkovPlugin < Plugin message = clean_str m.message wordlist = message.split(/\s+/) - return unless wordlist.length > 2 + return unless wordlist.length >= 2 @lastline = message word1, word2 = :nonword, :nonword wordlist.each do |word3| @@ -163,6 +166,7 @@ class MarkovPlugin < Plugin end @registry["#{word1}/#{word2}"] = [:nonword] + return if m.replied? random_markov(m, message) end end -- cgit v1.2.3