3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Check for existing temp ban before temp-banning

This commit is contained in:
Pragmatic Software 2017-05-23 17:05:25 -07:00
parent 7357ba706e
commit 29f6510ec2

View File

@ -225,9 +225,11 @@ sub on_mode {
}
if ($timeout && $self->{pbot}->{chanops}->can_gain_ops($channel)) {
$self->{pbot}->{logger}->log("Temp ban for $target in $channel.\n");
$self->{pbot}->{chanops}->{unban_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + $timeout;
$self->{pbot}->{chanops}->{unban_timeout}->save;
if (not exists $self->{pbot}->{chanops}->{unban_timeout}->hash->{lc $channel}->{lc $target}) {
$self->{pbot}->{logger}->log("Temp ban for $target in $channel.\n");
$self->{pbot}->{chanops}->{unban_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + $timeout;
$self->{pbot}->{chanops}->{unban_timeout}->save;
}
}
}
}