Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Firehose comment color changes

  • Loading branch information...
commit ef6e9db617abf4c92defe08471d87d7a400f565f 1 parent 7ec711f
@jamiemccarthy jamiemccarthy authored
View
8 plugins/FireHose/FireHose.pm
@@ -150,9 +150,9 @@ sub createItemFromComment {
# Set initial popularity scores -- we'll be forcing a quick
# recalculation of them so these scores don't much matter.
my($popularity, $editorpop, $neediness);
- $popularity = $self->getEntryPopularityForColorLevel(5);
- $editorpop = $self->getEntryPopularityForColorLevel(5);
- $neediness = $self->getEntryPopularityForColorLevel(5);
+ $popularity = $self->getEntryPopularityForColorLevel(7);
+ $editorpop = $self->getEntryPopularityForColorLevel(7);
+ $neediness = $self->getEntryPopularityForColorLevel(6);
my $data = {
uid => $comment->{uid},
@@ -172,7 +172,7 @@ sub createItemFromComment {
my $tagboxdb = getObject('Slash::Tagbox');
if ($tagboxdb) {
- for my $tbname (qw( FHPopularity FHEditorPop CommentScoreReason )) {
+ for my $tbname (qw( FireHoseScores FHEditorPop CommentScoreReason )) {
my $tagbox = $tagboxdb->getTagboxes($tbname);
next unless $tagbox;
$tagbox->{object}->forceFeederRecalc($globjid);
View
20 tagboxes/FireHoseScores/FireHoseScores.pm
@@ -40,6 +40,23 @@ sub init {
grep { $slashdb->getUser($_, 'seclev') >= 100 }
keys %$admins
};
+
+ # XXX See CommentScoreReason.pm, we should consolidate code
+
+ my $tagsdb = getObject('Slash::Tags');
+ my $moddb = getObject('Slash::TagModeration');
+ $self->{reasons} = $moddb->getReasons();
+ $self->{reason_tagnameid} = { };
+ $self->{reason_ids} = [
+ grep { $self->{reasons}{$_}{val} != 0 }
+ keys %{$self->{reasons}}
+ ];
+ for my $id (@{$self->{reason_ids}}) {
+ my $name = lc $self->{reasons}{$id}{name};
+ my $tagnameid = $tagsdb->getTagnameidCreate($name);
+ $self->{reason_tagnameid}{$tagnameid} = $self->{reasons}{$id};
+ }
+
1;
}
@@ -48,6 +65,7 @@ sub init_tagfilters {
$self->{filter_activeonly} = 1;
$self->{filter_firehoseonly} = 1;
$self->{filter_tagnameid} = [ @{$self}{qw( nodid nixid )} ];
+ push @{ $self->{filter_tagnameid} }, keys %{ $self->{reason_tagnameid} };
}
sub get_affected_type { 'globj' }
@@ -237,7 +255,7 @@ sub getStartingColorLevel {
my $score = constrain_score($comment->{points} + $comment->{tweak});
if ($score >= 5) {
$color_level = 4;
- } elsif ($score >= 3) {
+ } elsif ($score >= 4) {
$color_level = 5
} elsif ($score >= 1) {
$color_level = 6
Please sign in to comment.
Something went wrong with that request. Please try again.