From a91cd75c17124a9c863fd60da03c54555be4a43c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 22 Aug 2008 17:03:07 -0400 Subject: [PATCH] local-only is optional on public timeline darcs-hash:20080822210307-84dde-c90f6e7953d11c5b12c7a084ac23e5578412932c.gz --- actions/public.php | 4 +++- actions/publicrss.php | 4 +++- actions/twitapistatuses.php | 5 ++++- lib/common.php | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/actions/public.php b/actions/public.php index b66a3f0f13..f99215dadb 100644 --- a/actions/public.php +++ b/actions/public.php @@ -63,7 +63,9 @@ class PublicAction extends StreamAction { # XXX: sub-optimal - $notice->is_local = 1; + if (common_config('public', 'localonly')) { + $notice->is_local = 1; + } $notice->orderBy('created DESC, notice.id DESC'); diff --git a/actions/publicrss.php b/actions/publicrss.php index 185a4ff785..98a1908abf 100644 --- a/actions/publicrss.php +++ b/actions/publicrss.php @@ -38,7 +38,9 @@ class PublicrssAction extends Rss10Action { # XXX: bad performance - $notice->is_local = 1; + if (common_config('public', 'localonly')) { + $notice->is_local = 1; + } $notice->orderBy('created DESC, notice.id DESC'); diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 2f95d90c9d..3041240dde 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -61,7 +61,10 @@ class TwitapistatusesAction extends TwitterapiAction { # XXX: sub-optimal performance - $notice->is_local = 1; + if (common_config('public', 'localonly')) { + $notice->is_local = 1; + } + $notice->orderBy('created DESC, notice.id DESC'); $notice->limit($MAX_PUBSTATUSES); $cnt = $notice->find(); diff --git a/lib/common.php b/lib/common.php index 32ef6ea7bd..6db9f91fe4 100644 --- a/lib/common.php +++ b/lib/common.php @@ -77,6 +77,8 @@ $config = array('blacklist' => array()), 'avatar' => array('server' => NULL), + 'public' => + array('localonly' => true), 'theme' => array('server' => NULL), 'xmpp' => -- 2.39.5