From 7b6bb688befe2265a8a7eab684a9a28a2f19fe51 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 2 Jul 2018 23:34:11 -0700 Subject: [PATCH] Improve Net::IRC pacing to ignore pacing for initial 8 lines in a squelch --- PBot/IRC/Connection.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PBot/IRC/Connection.pm b/PBot/IRC/Connection.pm index b37b707b..929b921a 100644 --- a/PBot/IRC/Connection.pm +++ b/PBot/IRC/Connection.pm @@ -1391,6 +1391,10 @@ sub sl { if (! $self->pacing) { return $self->sl_real($line); } + + if (++$self->{_slcount} <= 8) { + return $self->schedule_output_event(0, \&sl_real, $line); + } # calculate how long to wait before sending this line my $time = time; @@ -1406,7 +1410,9 @@ sub sl { print STDERR "S-> $seconds $line\n"; } - print STDERR "S-> $seconds $line\n"; + if ($seconds == 0) { + $self->{_slcount} = 0; + } $self->schedule_output_event($seconds, \&sl_real, $line); }