Skip to content

Commit

Permalink
Changed DIGEST syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 18, 2002
1 parent 587d0bb commit 6b74b4c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions IcculusNews_daemon.pl
Expand Up @@ -32,7 +32,7 @@
#use IO::Handle; # blow.

# Version of IcculusNews. Change this if you are forking the code.
my $version = "2.0.0beta";
my $version = "2.0.1";


# Global rights constants.
Expand Down Expand Up @@ -974,9 +974,16 @@ sub generate_pword {


$commands{'DIGEST'} = sub {
my $max = shift;
if ((not defined $max) or ($max !~ /\A\d+\Z/)) {
report_error('argument must be number.');
my $args = shift;
my $max = undef;
my $startIndex = undef;

if (defined $args) {
($startIndex, $max) = ($args =~ /\A(\d+|\-)\s*(\d+)\Z/);
}

if ((not defined $max) or (not defined $startIndex)) {
report_error('USAGE: DIGEST <startIndex|-> <msgCount>');
return 1;
}

Expand All @@ -990,6 +997,10 @@ sub generate_pword {
" on i.author=u.id" .
" where i.queueid=$queue";

if ($startIndex ne '-') {
$sql = $sql . " and (i.id < $startIndex)";
}

if (!($current_queue_rights & canSeeDeleted)) {
$sql = $sql . ' and (i.deleted=0)';
}
Expand Down

0 comments on commit 6b74b4c

Please sign in to comment.