public timeline only gets local notices

darcs-hash:20080722142050-84dde-b948048b7f85e24c59dc063ef298bcc4c386d33a.gz
This commit is contained in:
Evan Prodromou 2008-07-22 10:20:50 -04:00
parent b1282b1b9f
commit 5f79bcdf51
3 changed files with 10 additions and 9 deletions

View File

@ -59,11 +59,11 @@ class PublicAction extends StreamAction {
function show_notices($page) { function show_notices($page) {
$notice = DB_DataObject::factory('notice'); $notice = new Notice();
# FIXME: bad performance # XXX: sub-optimal
$notice->whereAdd('EXISTS (SELECT user.id from user where user.id = notice.profile_id)'); $notice->is_local = 1;
$notice->orderBy('created DESC, notice.id DESC'); $notice->orderBy('created DESC, notice.id DESC');

View File

@ -34,11 +34,11 @@ class PublicrssAction extends Rss10Action {
$user = $this->user; $user = $this->user;
$notices = array(); $notices = array();
$notice = DB_DataObject::factory('notice'); $notice = new Notice();
# FIXME: bad performance # XXX: bad performance
$notice->whereAdd('EXISTS (SELECT user.id from user where user.id = notice.profile_id)'); $notice->is_local = 1;
$notice->orderBy('created DESC, notice.id DESC'); $notice->orderBy('created DESC, notice.id DESC');

View File

@ -40,13 +40,14 @@ class TwitapistatusesAction extends TwitterapiAction {
// Number of public statuses to return by default -- Twitter sends 20 // Number of public statuses to return by default -- Twitter sends 20
$MAX_PUBSTATUSES = 20; $MAX_PUBSTATUSES = 20;
$notice = DB_DataObject::factory('notice'); $notice = new Notice();
// FIXME: To really live up to the spec we need to build a list // FIXME: To really live up to the spec we need to build a list
// of notices by users who have custom avatars, so fix this SQL -- Zach // of notices by users who have custom avatars, so fix this SQL -- Zach
# FIXME: bad performance # XXX: sub-optimal performance
$notice->whereAdd('EXISTS (SELECT user.id from user where user.id = notice.profile_id)');
$notice->is_local = 1;
$notice->orderBy('created DESC, notice.id DESC'); $notice->orderBy('created DESC, notice.id DESC');
$notice->limit($MAX_PUBSTATUSES); $notice->limit($MAX_PUBSTATUSES);
$cnt = $notice->find(); $cnt = $notice->find();