Browse files

Bugfix: comments below user's threshold were showing up blank when cl…

…icked

on directly (comments.pl?sid=foo&cid=bar) unless the user manually adjusted
the threshold down (&threshold=-1).  Fixed.
  • Loading branch information...
1 parent e064a97 commit 2539fb710dd50b9612b1cd09fb8054d01a57fa9b @jamiemccarthy jamiemccarthy committed Mar 21, 2003
Showing with 20 additions and 3 deletions.
  1. +20 −3 Slash/Slash.pm
View
23 Slash/Slash.pm
@@ -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) {

0 comments on commit 2539fb7

Please sign in to comment.