From 4f5badda94071d9debc8dacfbc9072be3c2ee73d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 13 Oct 2009 17:38:27 -0400 Subject: remove inboxes option --- classes/User.php | 58 +++++++------------------------------------------------- 1 file changed, 7 insertions(+), 51 deletions(-) (limited to 'classes/User.php') diff --git a/classes/User.php b/classes/User.php index 48df0cdd7..0a70c9801 100644 --- a/classes/User.php +++ b/classes/User.php @@ -227,11 +227,9 @@ class User extends Memcached_DataObject } } - $inboxes = common_config('inboxes', 'enabled'); + // This flag is ignored but still set to 1 - if ($inboxes === true || $inboxes == 'transitional') { - $user->inboxed = 1; - } + $user->inboxed = 1; $user->created = common_sql_now(); $user->uri = common_user_uri($user); @@ -433,55 +431,16 @@ class User extends Memcached_DataObject function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { - $enabled = common_config('inboxes', 'enabled'); - - // Complicated code, depending on whether we support inboxes yet - // XXX: make this go away when inboxes become mandatory - - if ($enabled === false || - ($enabled == 'transitional' && $this->inboxed == 0)) { - $qry = - 'SELECT notice.* ' . - 'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' . - 'WHERE subscription.subscriber = %d ' . - 'AND notice.is_local != ' . Notice::GATEWAY; - return Notice::getStream(sprintf($qry, $this->id), - 'user:notices_with_friends:' . $this->id, - $offset, $limit, $since_id, $before_id, - $order, $since); - } else if ($enabled === true || - ($enabled == 'transitional' && $this->inboxed == 1)) { - - $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, false); + $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, false); - return Notice::getStreamByIds($ids); - } + return Notice::getStreamByIds($ids); } function noticeInbox($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) { - $enabled = common_config('inboxes', 'enabled'); - - // Complicated code, depending on whether we support inboxes yet - // XXX: make this go away when inboxes become mandatory + $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, true); - if ($enabled === false || - ($enabled == 'transitional' && $this->inboxed == 0)) { - $qry = - 'SELECT notice.* ' . - 'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' . - 'WHERE subscription.subscriber = %d '; - return Notice::getStream(sprintf($qry, $this->id), - 'user:notices_with_friends:' . $this->id, - $offset, $limit, $since_id, $before_id, - $order, $since); - } else if ($enabled === true || - ($enabled == 'transitional' && $this->inboxed == 1)) { - - $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, true); - - return Notice::getStreamByIds($ids); - } + return Notice::getStreamByIds($ids); } function blowFavesCache() @@ -752,12 +711,9 @@ class User extends Memcached_DataObject 'Remember_me', 'Foreign_link', 'Invitation', + 'Notice_inbox', ); - if (common_config('inboxes', 'enabled')) { - $related[] = 'Notice_inbox'; - } - foreach ($related as $cls) { $inst = new $cls(); $inst->user_id = $this->id; -- cgit v1.2.3-54-g00ecf