mirror of
https://github.com/pragma-/pbot.git
synced 2025-10-12 05:57:25 +02:00
RelayUnreg: Correct notification timeout behavior
This commit is contained in:
parent
07c9762cb7
commit
93b386b0ca
@ -103,8 +103,7 @@ 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 ($now >= $time) {
|
||||||
@ -117,14 +116,17 @@ sub check_queue {
|
|||||||
}
|
}
|
||||||
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}}) {
|
||||||
|
my $timeout = gettimeofday - 60 * 15;
|
||||||
foreach my $nick (keys %{$self->{notified}}) {
|
foreach my $nick (keys %{$self->{notified}}) {
|
||||||
if ($self->{notified}->{$nick} >= $timeout) {
|
if ($self->{notified}->{$nick} <= $timeout) {
|
||||||
delete $self->{notified}->{$nick};
|
delete $self->{notified}->{$nick};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user