Skip to content

Commit

Permalink
Bugfix: comments below user's threshold were showing up blank when cl…
Browse files Browse the repository at this point in the history
…icked

on directly (comments.pl?sid=foo&cid=bar) unless the user manually adjusted
the threshold down (&threshold=-1).  Fixed.
  • Loading branch information
jamiemccarthy committed Mar 21, 2003
1 parent e064a97 commit 2539fb7
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions Slash/Slash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,26 @@ sub selectComments {
if ($user->{threshold} <= $min) {
@cids_over_thresh = keys %$comments;
} else {
@cids_over_thresh =
grep { $comments->{$_}{points} >= $user->{threshold} }
keys %$comments;
if ($user->{is_anon}) {
# Only load comment text for comments scored at or
# above our threshold, plus the one comment we
# specifically asked for.
@cids_over_thresh = grep {
$comments->{$_}{points} >= $user->{threshold}
||
$_ == $cid
} keys %$comments;
} else {
# Load comments text for those, plus any comments
# posted by us no matter what their score or cid.
@cids_over_thresh = grep {
$comments->{$_}{points} >= $user->{threshold}
||
$comments->{$_}{uid} == $user->{uid}
||
$_ == $cid
} keys %$comments;
}
}
my $comment_text_hr = $slashdb->getCommentTextOld(\@cids_over_thresh);
for my $cid (@cids_over_thresh) {
Expand Down

0 comments on commit 2539fb7

Please sign in to comment.