From 66dcfce7a46c40373398217332dfe36c1dd35cc4 Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 17 Jan 2015 16:51:10 -0500 Subject: handle no files served --- xdcc.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xdcc.pl b/xdcc.pl index ccfd27e..3ffc3e5 100755 --- a/xdcc.pl +++ b/xdcc.pl @@ -39,10 +39,10 @@ my $help_local = < ] [-del ] [-list] [-stats] [-help] --add: Add a file to our XDCC server. --del: Remove a file from the offerings. --list: Display the XDCC list (default). --reset: Reset the file list and the queue. +-add: Add a file to our XDCC server +-del: Remove a file from the offerings +-list: Display the XDCC list (default) +-reset: Reset the file list and the queue -stats: Statistics for this session -enable: Enable the XDCC server -disable: Disable the XDCC server @@ -157,8 +157,13 @@ sub xdcc_enqueue { id => $id }; + if (scalar @files == 0) { + xdcc_message( $server, $nick, 'no_files_offered' ); + return; + } if (! $sending && @queue == 0) { - return xdcc_send($request); + xdcc_send($request); + return; } elsif (@queue > $queue_max) { xdcc_message( $server, $nick, 'queue_is_full' ); -- cgit v1.2.3-70-g09d2