コミットメタ情報

リビジョン5b919aafbc592ed78b10e58120f19cdfb5c53318 (tree)
日時2017-11-20 19:30:11
作者hylom <hylom@user...>
コミッターhylom

ログメッセージ

  • Model::Timeline: fix to hide 'public == no' items

変更サマリ

差分

--- a/src/newslash_web/lib/Newslash/Model/Timeline.pm
+++ b/src/newslash_web/lib/Newslash/Model/Timeline.pm
@@ -147,6 +147,17 @@ sub _select_user {
147147 my ($self, $uid, $params) = @_;
148148 my ($limit_clause, $limit_values) = $self->build_limit_clause(params => $params);
149149
150+ # show future story?
151+ my $extra_where_clause = "";
152+ if (!$params->{show_future}) {
153+ $extra_where_clause = $extra_where_clause . " AND firehose.createtime <= NOW() ";
154+ }
155+
156+ # show non-public story?
157+ if (!$params->{show_nonpublic} && !$params->{public}) {
158+ $extra_where_clause = $extra_where_clause . " AND firehose.public != 'no' ";
159+ }
160+
150161 my $sql = <<"EOSQL";
151162 SELECT firehose.*,
152163 firehose_text.*,
@@ -157,6 +168,7 @@ SELECT firehose.*,
157168 JOIN users ON firehose.uid = users.uid
158169 JOIN topics ON firehose.tid = topics.tid
159170 WHERE firehose.uid = ?
171+ $extra_where_clause
160172 ORDER BY createtime DESC $limit_clause
161173 EOSQL
162174 my @params;
旧リポジトリブラウザで表示