Squashed commit of the following:
commit 6216ef2c9c1ab4bb038177f90b97127e4c2b6d00 Author: Evan Prodromou <evan@status.net> Date: Tue Apr 3 17:14:07 2012 -0400 filter the notices commit 57fe6c012d380a8f2f8ec505f35e2094e58b4ac4 Author: Evan Prodromou <evan@status.net> Date: Tue Apr 3 17:08:36 2012 -0400 return value, end condition commit cc985407f89f2d222f3164f8bc14b0764163e83f Author: Evan Prodromou <evan@status.net> Date: Tue Apr 3 17:06:49 2012 -0400 fix call to count() commit 9efdfde70ea307b7409a4140647f343224cb595f Author: Evan Prodromou <evan@status.net> Date: Tue Apr 3 17:06:05 2012 -0400 fix class name in pivotGet commit 311599ac117dda8b6cd5f522687322b89dcc909d Author: Evan Prodromou <evan@status.net> Date: Tue Apr 3 17:03:28 2012 -0400 inboxfix
This commit is contained in:
parent
a51d2ece50
commit
ea0a1b6a03
|
@ -135,4 +135,30 @@ class RawInboxNoticeStream extends NoticeStream
|
|||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
function getNotices($offset, $limit, $sinceId, $maxId)
|
||||
{
|
||||
$all = array();
|
||||
|
||||
do {
|
||||
|
||||
$ids = $this->getNoticeIds($offset, $limit, $sinceId, $maxId);
|
||||
|
||||
$notices = Memcached_DataObject::pivotGet('Notice', 'id', $ids);
|
||||
|
||||
// By default, takes out false values
|
||||
|
||||
$notices = array_filter($notices);
|
||||
|
||||
$all = array_merge($all, $notices);
|
||||
|
||||
if (count($notices < count($ids))) {
|
||||
$offset += $limit;
|
||||
$limit -= count($notices);
|
||||
}
|
||||
|
||||
} while (count($notices) < count($ids) && count($ids) > 0);
|
||||
|
||||
return new ArrayWrapper($all);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user