diff --git a/INDEV b/INDEV index 8792dabb..a34ef795 100644 --- a/INDEV +++ b/INDEV @@ -3428,3 +3428,7 @@ CHANGES: fixed some oper notices which were broken since the changes to ->notice_info(). silented annoying warnings produced by load_or_reload(). added ridiculous experimental fake user for #32. + + 57. added incoming TS6 handlers for KLINE, ENCAP KLINE, ENCAP DLINE. #32. + added convenience function add_update_enforce_activate_ban to Ban. + added support for TS6 capabilities KLN and UNKLN. diff --git a/VERSION b/VERSION index 97db3e7f..eaa113e0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.56 +11.57 diff --git a/modules/Ban/Ban.module/Ban.json b/modules/Ban/Ban.module/Ban.json index 78fc08d5..ca1db6dc 100644 --- a/modules/Ban/Ban.module/Ban.json +++ b/modules/Ban/Ban.module/Ban.json @@ -12,5 +12,5 @@ "description" : "provides an interface for user and server banning", "name" : "Ban", "package" : "M::Ban", - "version" : "9.3" + "version" : "9.4" } diff --git a/modules/Ban/Ban.module/Ban.pm b/modules/Ban/Ban.module/Ban.pm index 4f020df9..3b02712f 100644 --- a/modules/Ban/Ban.module/Ban.pm +++ b/modules/Ban/Ban.module/Ban.pm @@ -62,7 +62,8 @@ our ($table, %ban_types, %timers); # # reason user-set reason for ban # - +# _just_set_by UID of user who set a ban. used for propagation. +# sub init { $table = $conf->table('bans') or return; @@ -184,6 +185,13 @@ sub delete_ban_by_id { $table->row(id => $id)->delete; } +sub add_update_enforce_activate_ban { + my %ban = @_ or return; + add_or_update_ban(%ban); + enforce_ban(%ban); + activate_ban(%ban); +} + ############### ### BAN API ### ############### @@ -270,9 +278,7 @@ sub register_ban { %opts ); - add_or_update_ban(%ban); - enforce_ban(%ban); - activate_ban(%ban); + add_update_enforce_activate_ban(%ban); # forward it $pool->fire_command_all(baninfo => \%ban); diff --git a/modules/Ban/Ban.module/JELP.module/JELP.json b/modules/Ban/Ban.module/JELP.module/JELP.json index 2521302d..2ce0110e 100644 --- a/modules/Ban/Ban.module/JELP.module/JELP.json +++ b/modules/Ban/Ban.module/JELP.module/JELP.json @@ -11,5 +11,5 @@ "description" : "JELP ban propagation", "name" : "Ban::JELP", "package" : "M::Ban::JELP", - "version" : "0.9" + "version" : "1" } diff --git a/modules/Ban/Ban.module/JELP.module/JELP.pm b/modules/Ban/Ban.module/JELP.module/JELP.pm index d5d33379..fa4d83b0 100644 --- a/modules/Ban/Ban.module/JELP.module/JELP.pm +++ b/modules/Ban/Ban.module/JELP.module/JELP.pm @@ -21,9 +21,8 @@ use strict; use 5.010; M::Ban->import(qw( - enforce_ban activate_ban enforce_ban get_all_bans ban_by_id - add_or_update_ban delete_ban_by_id + delete_ban_by_id add_update_enforce_activate_ban )); our ($api, $mod, $pool, $conf, $me); @@ -186,9 +185,8 @@ sub scmd_baninfo { return unless defined $ban{id}; # update, enforce, and activate - add_or_update_ban(%ban); - enforce_ban(%ban); - activate_ban(%ban); + add_update_enforce_activate_ban(%ban); + } diff --git a/modules/Ban/Ban.module/TS6.module/TS6.json b/modules/Ban/Ban.module/TS6.module/TS6.json index c45214fa..f6f0c246 100644 --- a/modules/Ban/Ban.module/TS6.module/TS6.json +++ b/modules/Ban/Ban.module/TS6.module/TS6.json @@ -11,5 +11,5 @@ "description" : "TS6 ban propagation", "name" : "Ban::TS6", "package" : "M::Ban::TS6", - "version" : "2.7" + "version" : "3" } diff --git a/modules/Ban/Ban.module/TS6.module/TS6.pm b/modules/Ban/Ban.module/TS6.module/TS6.pm index 357fea74..7e71ac17 100644 --- a/modules/Ban/Ban.module/TS6.module/TS6.pm +++ b/modules/Ban/Ban.module/TS6.module/TS6.pm @@ -24,9 +24,8 @@ use utils qw(fnv v); use M::TS6::Utils qw(ts6_id); M::Ban->import(qw( - enforce_ban activate_ban enforce_ban get_all_bans ban_by_id - add_or_update_ban delete_ban_by_id + delete_ban_by_id add_update_enforce_activate_ban )); our ($api, $mod, $pool, $conf, $me); @@ -43,16 +42,22 @@ our %ts6_outgoing_commands = ( ); our %ts6_incoming_commands = ( - ENCAP_KLINE => { - # :uid ENCAP target KLINE duration ident_mask host_mask :reason - params => '-source(user) * * * * * *', - code => \&encap_kline - }, ENCAP_DLINE => { # :uid ENCAP target DLINE duration ip_mask :reason params => '-source(user) * * * * *', - code => \encap_&dline - } + code => \&encap_dline + }, + ENCAP_KLINE => { + # : ENCAP KLINE