From 425f9d703c5258920079b268c085b0c7112c3b70 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 29 May 2009 16:54:24 -0700 Subject: Ticket #1567 - Change max_id to return notices <= ID instead of < ID --- classes/Profile.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'classes/Profile.php') diff --git a/classes/Profile.php b/classes/Profile.php index ae5641d79..3d13cd46a 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -153,18 +153,18 @@ class Profile extends Memcached_DataObject return null; } - function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) + function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0) { // XXX: I'm not sure this is going to be any faster. It probably isn't. $ids = Notice::stream(array($this, '_streamDirect'), array(), 'profile:notice_ids:' . $this->id, - $offset, $limit, $since_id, $before_id); + $offset, $limit, $since_id, $max_id); return Notice::getStreamByIds($ids); } - function _streamDirect($offset, $limit, $since_id, $before_id, $since) + function _streamDirect($offset, $limit, $since_id, $max_id, $since) { $notice = new Notice(); @@ -177,8 +177,8 @@ class Profile extends Memcached_DataObject $notice->whereAdd('id > ' . $since_id); } - if ($before_id != 0) { - $notice->whereAdd('id < ' . $before_id); + if ($max_id != 0) { + $notice->whereAdd('id <= ' . $max_id); } if (!is_null($since)) { -- cgit v1.2.3-54-g00ecf