3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-06 11:28:43 +02:00

RelayUnreg: Correct notification timeout behavior

This commit is contained in:
Pragmatic Software 2018-08-13 20:05:42 -07:00
parent 07c9762cb7
commit 93b386b0ca

View File

@ -103,8 +103,7 @@ sub check_queue {
my $self = shift;
my $now = gettimeofday;
return if not @{$self->{queue}};
if (@{$self->{queue}}) {
my ($time, $channel, $nick, $user, $host, $msg) = @{$self->{queue}->[0]};
if ($now >= $time) {
@ -117,14 +116,17 @@ sub check_queue {
}
shift @{$self->{queue}};
}
}
# check notification timeouts here too, why not?
my $timeout = gettimeofday + 60 * 15;
if (keys %{$self->{notified}}) {
my $timeout = gettimeofday - 60 * 15;
foreach my $nick (keys %{$self->{notified}}) {
if ($self->{notified}->{$nick} >= $timeout) {
if ($self->{notified}->{$nick} <= $timeout) {
delete $self->{notified}->{$nick};
}
}
}
}
1;