diff options
author | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-10-13 15:37:44 +0000 |
---|---|---|
committer | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-10-13 15:37:44 +0000 |
commit | 8b0e2e09f81a7d89ceb52e947e9db12a206a8c37 (patch) | |
tree | 9ad17bf9e5597226c3e9db2ec3b95425e30974ab /data/rbot/plugins/markov.rb | |
parent | d5257757e7cbe3067ba3befb8ea98dd9cd3f5c54 (diff) |
various outstanding changes
Diffstat (limited to 'data/rbot/plugins/markov.rb')
-rw-r--r-- | data/rbot/plugins/markov.rb | 8 |
1 files changed, 6 insertions, 2 deletions
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 |