mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 22:09:26 +01: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 $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;
|
||||
|
Loading…
Reference in New Issue
Block a user