diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-08-10 22:21:37 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-08-10 22:21:37 +0000 |
commit | 65c383b7e2ead0c39d0843fc81094e1fa5e96ded (patch) | |
tree | e35bd7ce5803130300e33bc6d1e191ae63c3532b /data/rbot/plugins/autoop.rb | |
parent | 1a8637103406b0c4b6c49939dbf22474d18ed888 (diff) |
AutoOp now triggers on nick change too
Diffstat (limited to 'data/rbot/plugins/autoop.rb')
-rw-r--r-- | data/rbot/plugins/autoop.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/data/rbot/plugins/autoop.rb b/data/rbot/plugins/autoop.rb index 5f416e41..a47375ca 100644 --- a/data/rbot/plugins/autoop.rb +++ b/data/rbot/plugins/autoop.rb @@ -14,6 +14,24 @@ class AutoOP < Plugin } end + def nick(m) + return if m.address? + is_on = m.server.channels.inject(ChannelList.new) { |list, ch| + list << ch if ch.users.include?(m.source) + list + } + is_on.each { |channel| + ch = channel.to_s + @registry.each { |mask,channels| + if m.source.matches?(mask.to_irc_netmask(:server => m.server)) && + (channels.empty? || channels.include?(ch)) + @bot.mode(ch, "+o", m.source.nick) + return + end + } + } + end + def add(m, params) @registry[params[:mask]] = params[:channels].dup m.okay |