3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 10:59:29 +01:00

ChanOpCommands: ban/mute now use default timeout registry entries

This commit is contained in:
Pragmatic Software 2019-11-25 13:57:37 -08:00
parent 8b60162a10
commit 369a763af1

View File

@ -127,8 +127,7 @@ sub checkmute {
} }
sub ban_user { sub ban_user {
my $self = shift; my ($self, $from, $nick, $user, $host, $arguments, $stuff) = @_;
my ($from, $nick, $user, $host, $arguments, $stuff) = @_;
my ($target, $channel, $length) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 3); my ($target, $channel, $length) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 3);
$channel = '' if not defined $channel; $channel = '' if not defined $channel;
@ -153,7 +152,8 @@ sub ban_user {
my $no_length = 0; my $no_length = 0;
if (not defined $length) { if (not defined $length) {
$length = 60 * 60 * 24; # 24 hours $length = $self->{pbot}->{registry}->get_value($channel, 'default_ban_timeout', 0, $stuff) //
$self->{pbot}->{registry}->get_value('general', 'default_ban_timeout', 0, $stuff) // 60 * 60 * 24; # 24 hours
$no_length = 1; $no_length = 1;
} else { } else {
my $error; my $error;
@ -253,8 +253,7 @@ sub unban_user {
} }
sub mute_user { sub mute_user {
my $self = shift; my ($self, $from, $nick, $user, $host, $arguments, $stuff) = @_;
my ($from, $nick, $user, $host, $arguments, $stuff) = @_;
my ($target, $channel, $length) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 3); my ($target, $channel, $length) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 3);
if (not defined $from) { if (not defined $from) {
@ -284,7 +283,8 @@ sub mute_user {
my $no_length = 0; my $no_length = 0;
if (not defined $length) { if (not defined $length) {
$length = 60 * 60 * 24; # 24 hours $length = $self->{pbot}->{registry}->get_value($channel, 'default_mute_timeout', 0, $stuff) //
$self->{pbot}->{registry}->get_value('general', 'default_mute_timeout', 0, $stuff) // 60 * 60 * 24; # 24 hours
$no_length = 1; $no_length = 1;
} else { } else {
my $error; my $error;