From c636971540fc10d1b36cf3f0f5126d8f2f543f73 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 16 Jan 2015 09:56:44 -0500 Subject: check if sending --- xdcc.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xdcc.pl b/xdcc.pl index 230613b..247d9d1 100755 --- a/xdcc.pl +++ b/xdcc.pl @@ -22,6 +22,7 @@ my @queue; my $queue_max = 10; my $irssidir = Irssi::get_irssi_dir(); +my $sending = false; my $help = < $id }; - if (@queue == 0) { + if (! $sending && @queue == 0) { return xdcc_send($request); } elsif (@queue > $queue_max) { @@ -169,6 +170,7 @@ sub xdcc_send { Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'xdcc_sending_file', $id, $nick, $file->{fn}); $server->command("/DCC send $nick $path"); xdcc_message( $server, $nick, 'sending_file', $file->{fn} ) + $sending = true; } # client stuff @@ -263,6 +265,7 @@ sub dcc_created { } sub dcc_destroyed { Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'xdcc_log', 'dcc destroyed'); + $sending = false; if (@queue == 0) { return; } my $request = shift @queue; xdcc_send($request); -- cgit v1.2.3-70-g09d2