Skip to content

Commit

Permalink
Properly calculate comment points in reply screen
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Jun 7, 2005
1 parent c921a5c commit 662a52b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions themes/slashcode/htdocs/comments.pl
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,18 @@ sub editComment {
my $pid = $form->{pid} || 0; # this is guaranteed numeric, from filter_params
my $reply = $slashdb->getCommentReply($sid, $pid);

# calculate proper points value ... maybe this should be a public,
# and *sane*, API? like, no need to pass reasons, users, or min/max,
# or even user (get those all automatically if not passed);
# but that might be dangerous, since $reply/$comment is a little
# bit specific -- pudge
$reply->{points} = Slash::_get_points(
$reply, $user,
$constants->{comment_minscore}, $constants->{comment_maxscore},
$slashdb->countUsers({ max => 1 }), $slashdb->getReasons
);


# If anon posting is turned off, forbid it. The "post anonymously"
# checkbox should not appear in such a case, but check that field
# just in case the user fudged it.
Expand Down

0 comments on commit 662a52b

Please sign in to comment.