- @@handlers = {
- "add" => "handle_addop",
- "rm" => "handle_rmop",
- "list" => "handle_listop"
+ Config.register Config::BooleanValue.new('autoop.on_nick',
+ :default => true,
+ :desc => "Determines if the bot should auto-op when someone changes nick and the new nick matches a listed netmask")
+
+ def help(plugin, topic="")
+ return "perform autoop based on hostmask - usage: add <hostmask> [channel channel ...], rm <hostmask> [channel], list - list current ops. If you don't specify which channels, all channels are assumed"
+ end
+
+ def join(m)
+ return if m.address?
+ @registry.each { |mask,channels|
+ if m.source.matches?(mask.to_irc_netmask(:server => m.server)) &&
+ (channels.empty? || channels.include?(m.channel.to_s))
+ @bot.mode(m.channel, "+o", m.source.nick)
+ return
+ end