X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fbans.rb;h=ac5262b780192b2cf98ed6eee76d354bb489b08b;hb=27ee4fabaebdb1f78b1eb6cfb31c43f1dc5a7f49;hp=dfbe116da89c0ce6815a9117f79a0102f26ad5c8;hpb=4afae844a82a7a88a5bfc1a02e4a269190e87dbc;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/bans.rb b/data/rbot/plugins/bans.rb index dfbe116d..ac5262b7 100644 --- a/data/rbot/plugins/bans.rb +++ b/data/rbot/plugins/bans.rb @@ -1,10 +1,19 @@ -# BansPlugin v3 for 0.9.11 +#-- vim:sw=2:et +#++ # -# Managing kick and bans, automatically removing bans after timeouts, quiet bans, and kickban/quietban based on regexp +# :title: Bans Plugin v3 for rbot 0.9.11 and later # -# (c) 2006 Marco Gulino -# (c) 2007 kamu -# (c) 2007 Giuseppe Bilotta +# Author:: Marco Gulino +# Author:: kamu +# Author:: Giuseppe Bilotta +# +# Copyright:: (C) 2006 Marco Gulino +# Copyright:: (C) 2007 kamu, Giuseppe Bilotta +# +# License:: GPL V2. +# +# Managing kick and bans, automatically removing bans after timeouts, quiet +# bans, and kickban/quietban based on regexp # # v1 -> v2 (kamu's version, never released) # * reworked @@ -13,20 +22,19 @@ # # v2 -> v3 (GB) # * remove the 'bans' prefix from most of the commands -# * (un)quiet has been renamed to (un)silence because 'quiet' was used to tell the bot to keep quiet +# * (un)quiet has been renamed to (un)silence because 'quiet' was used to +# tell the bot to keep quiet # * both (un)quiet and (un)silence are accepted as actions # * use the more descriptive 'onjoin' term for autoactions -# * convert v1's (0.9.10) :bans and :bansmasks to BadWordActions and WhitelistEntries +# * convert v1's (0.9.10) :bans and :bansmasks to BadWordActions and +# WhitelistEntries # * enhanced list manipulation facilities # * fixed regexp usage in requirements for plugin map # * add proper auth management -# -# Licensed under GPL V2. - -OnJoinAction = Struct.new("OnJoinAction", :host, :action, :channel, :reason) -BadWordAction = Struct.new("BadWordAction", :regexp, :action, :channel, :timer, :reason) -WhitelistEntry = Struct.new("WhitelistEntry", :host, :channel) +define_structure :OnJoinAction, :host, :action, :channel, :reason +define_structure :BadWordAction, :regexp, :action, :channel, :timer, :reason +define_structure :WhitelistEntry, :host, :channel class BansPlugin < Plugin @@ -59,7 +67,7 @@ class BansPlugin < Plugin action = :kickban else # Shouldn't happen - warn "Unknown action in old data #{ar.inspect} -- entry ignored" + warning "Unknown action in old data #{ar.inspect} -- entry ignored" next end bans.delete(ar)