mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 13:59:47 +01:00
Automatically unmute +q'd offenders after mute_timeout (7 days)
This commit is contained in:
parent
b98ef02b6f
commit
d0ebf98441
@ -35,6 +35,7 @@ sub initialize {
|
||||
$self->{banlist} = {};
|
||||
|
||||
$self->{pbot}->{registry}->add_default('text', 'bantracker', 'chanserv_ban_timeout', '604800');
|
||||
$self->{pbot}->{registry}->add_default('text', 'bantracker', 'mute_timeout', '604800');
|
||||
$self->{pbot}->{registry}->add_default('text', 'bantracker', 'debug', '0');
|
||||
|
||||
$self->{pbot}->{commands}->register(sub { $self->dumpbans(@_) }, "dumpbans", 60);
|
||||
|
@ -203,6 +203,14 @@ sub on_mode {
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif($mode eq "+q") {
|
||||
if($nick ne $event->{conn}->nick) {
|
||||
if (exists $self->{pbot}->{channels}->{channels}->hash->{$channel} and $self->{pbot}->{channels}->{channels}->hash->{$channel}{chanop}) {
|
||||
$self->{pbot}->{chanops}->{unmute_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + $self->{pbot}->{registry}->get_value('bantracker', 'mute_timeout');
|
||||
$self->{pbot}->{chanops}->{unmute_timeout}->save;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif($mode eq "+e" && $channel eq $event->{conn}->nick) {
|
||||
foreach my $chan (keys %{ $self->{pbot}->{channels}->{channels}->hash }) {
|
||||
if($self->{channels}->{channels}->hash->{$chan}{enabled}) {
|
||||
|
Loading…
Reference in New Issue
Block a user