Skip to content
Browse files

cleanup

  • Loading branch information...
1 parent fee964f commit 43facca6f4d8d67075f5b136e6e54e45e0d72033 @pudge pudge committed Mar 28, 2007
Showing with 14 additions and 15 deletions.
  1. +14 −15 plugins/FireHose/FireHose.pm
View
29 plugins/FireHose/FireHose.pm
@@ -279,6 +279,10 @@ sub getFireHoseEssentials {
$options ||= {};
$options->{limit} ||= 50;
+ my $pop;
+ $pop = $self->getMinPopularityForColorLevel($colors->{$options->{color}})
+ if $options->{colors} && $colors->{$options->{color}};
+
my($items, $results, $doublecheck) = ([], {}, 0);
# for now, only bother to try searchtoo if there is a qfilter value to search on
if (!$options->{no_search} && $constants->{firehose_searchtoo} && $options->{qfilter}) {
@@ -434,26 +438,21 @@ sub getFireHoseEssentials {
push @where, "createtime >= DATE_SUB(NOW(), INTERVAL $dur_q DAY)";
}
- if ($options->{color}) {
- if ($colors->{$options->{color}}) {
- my $pop = $self->getMinPopularityForColorLevel($colors->{$options->{color}});
- my $pop_q = $self->sqlQuote($pop);
- if ($user->{is_admin} && !$user->{firehose_usermode}) {
- push @where, "editorpop >= $pop_q";
- } else {
- push @where, "popularity >= $pop_q";
- }
+ if ($pop) {
+ my $pop_q = $self->sqlQuote($pop);
+ if ($user->{is_admin} && !$user->{firehose_usermode}) {
+ push @where, "editorpop >= $pop_q";
+ } else {
+ push @where, "popularity >= $pop_q";
}
}
if ($user->{is_admin}) {
my $signoff_label = "sign" . $user->{uid} . "ed";
- if ($options->{unsigned}) {
- push @where, "signoffs NOT LIKE \"\%$signoff_label\%\"";
- }
-
if ($options->{signed}) {
push @where, "signoffs LIKE \"\%$signoff_label\%\"";
+ } elsif ($options->{unsigned}) {
+ push @where, "signoffs NOT LIKE \"\%$signoff_label\%\"";
}
}
@@ -835,7 +834,7 @@ sub ajaxFireHoseGetUpdates {
foreach (@$items) {
push @$globjs, $_->{globjid} if $_->{globjid}
}
-
+
if ($opts->{orderby} eq "createtime") {
$items = $firehose->addDayBreaks($items, $user->{off_set});
@@ -1782,7 +1781,7 @@ sub splitOpsFromString {
}
sub addDayBreaks {
- my ($self, $items, $offset) = @_;
+ my($self, $items, $offset) = @_;
my @retitems;
my $last_day = "00000000";
my $days_processed = 0;

0 comments on commit 43facca

Please sign in to comment.
Something went wrong with that request. Please try again.