mirror of
https://github.com/pragma-/pbot.git
synced 2025-10-11 13:37:25 +02:00
RelayUnreg: Correct notification timeout behavior
This commit is contained in:
parent
07c9762cb7
commit
93b386b0ca
@ -103,26 +103,28 @@ sub check_queue {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $now = gettimeofday;
|
my $now = gettimeofday;
|
||||||
|
|
||||||
return if not @{$self->{queue}};
|
if (@{$self->{queue}}) {
|
||||||
|
my ($time, $channel, $nick, $user, $host, $msg) = @{$self->{queue}->[0]};
|
||||||
|
|
||||||
my ($time, $channel, $nick, $user, $host, $msg) = @{$self->{queue}->[0]};
|
if ($now >= $time) {
|
||||||
|
# if nick is still present in channel, send the message
|
||||||
if ($now >= $time) {
|
if ($self->{pbot}->{nicklist}->is_present($channel, $nick)) {
|
||||||
# if nick is still present in channel, send the message
|
# ensure they're not banned (+z allows us to see +q/+b messages as normal ones)
|
||||||
if ($self->{pbot}->{nicklist}->is_present($channel, $nick)) {
|
my $banned = $self->{pbot}->{bantracker}->is_banned($nick, $user, $host, $channel);
|
||||||
# ensure they're not banned (+z allows us to see +q/+b messages as normal ones)
|
$self->{pbot}->{logger}->log("[RelayUnreg] $nick!$user\@$host $banned->{mode} as $banned->{banmask} in $banned->{channel} by $banned->{owner}, not relaying unregistered message\n") if $banned;
|
||||||
my $banned = $self->{pbot}->{bantracker}->is_banned($nick, $user, $host, $channel);
|
$self->{pbot}->{conn}->privmsg($channel, "(unreg) <$nick> $msg") unless $banned;
|
||||||
$self->{pbot}->{logger}->log("[RelayUnreg] $nick!$user\@$host $banned->{mode} as $banned->{banmask} in $banned->{channel} by $banned->{owner}, not relaying unregistered message\n") if $banned;
|
}
|
||||||
$self->{pbot}->{conn}->privmsg($channel, "(unreg) <$nick> $msg") unless $banned;
|
shift @{$self->{queue}};
|
||||||
}
|
}
|
||||||
shift @{$self->{queue}};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# check notification timeouts here too, why not?
|
# check notification timeouts here too, why not?
|
||||||
my $timeout = gettimeofday + 60 * 15;
|
if (keys %{$self->{notified}}) {
|
||||||
foreach my $nick (keys %{$self->{notified}}) {
|
my $timeout = gettimeofday - 60 * 15;
|
||||||
if ($self->{notified}->{$nick} >= $timeout) {
|
foreach my $nick (keys %{$self->{notified}}) {
|
||||||
delete $self->{notified}->{$nick};
|
if ($self->{notified}->{$nick} <= $timeout) {
|
||||||
|
delete $self->{notified}->{$nick};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user