3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01: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,12 +225,14 @@ sub on_mode {
}
if ($timeout && $self->{pbot}->{chanops}->can_gain_ops($channel)) {
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;
}
}
}
}
elsif($mode eq "+q") {
if($nick ne $event->{conn}->nick) {
if ($self->{pbot}->{chanops}->can_gain_ops($channel)) {