summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-04 14:50:20 -0800
committerBrion Vibber <brion@pobox.com>2010-02-04 15:09:04 -0800
commit9554b4ccbf0783516ea1735a7c999919be33c280 (patch)
tree3f73146fa0c5ed2bca7f01fb6e86a6d36b5a2e62 /classes/User.php
parented8553eea8b308ae0e686fdf96d3e209e83be28c (diff)
Inbox::streamNotices() with deletion compensation: inbox paging should more or less work with deleted items now.
No change in efficiency for the common case where nothing's deleted: does the same bulk fetch of just the notices we think we'll need as before, then if we turned up short keeps checking one by one until we've filled up to our $limit. This can leave us with overlap between pages, but we already have that when new messages come in between clicks; seems to be the lesser of evils versus not getting a 'before' button. More permanent fix for that will be to switch timeline paging in the UI to use notice IDs.
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/classes/User.php b/classes/User.php
index 0ab816b57..72c3f39e9 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -502,28 +502,22 @@ class User extends Memcached_DataObject
function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
{
- $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, false);
- return Notice::getStreamByIds($ids);
+ return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, false);
}
function noticeInbox($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
{
- $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, true);
- return Notice::getStreamByIds($ids);
+ return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, true);
}
function friendsTimeline($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
{
- $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, false);
-
- return Notice::getStreamByIds($ids);
+ return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, false);
}
function ownFriendsTimeline($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
{
- $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, true);
-
- return Notice::getStreamByIds($ids);
+ return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, true);
}
function blowFavesCache()