From: Evan Prodromou Date: Tue, 3 Apr 2012 21:15:58 +0000 (-0400) Subject: Squashed commit of the following: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ea0a1b6a03accf04c770ce5195713bd7d8039828;p=quix0rs-gnu-social.git Squashed commit of the following: commit 6216ef2c9c1ab4bb038177f90b97127e4c2b6d00 Author: Evan Prodromou Date: Tue Apr 3 17:14:07 2012 -0400 filter the notices commit 57fe6c012d380a8f2f8ec505f35e2094e58b4ac4 Author: Evan Prodromou Date: Tue Apr 3 17:08:36 2012 -0400 return value, end condition commit cc985407f89f2d222f3164f8bc14b0764163e83f Author: Evan Prodromou Date: Tue Apr 3 17:06:49 2012 -0400 fix call to count() commit 9efdfde70ea307b7409a4140647f343224cb595f Author: Evan Prodromou Date: Tue Apr 3 17:06:05 2012 -0400 fix class name in pivotGet commit 311599ac117dda8b6cd5f522687322b89dcc909d Author: Evan Prodromou Date: Tue Apr 3 17:03:28 2012 -0400 inboxfix --- diff --git a/lib/inboxnoticestream.php b/lib/inboxnoticestream.php index 5517cef113..58b0075050 100644 --- a/lib/inboxnoticestream.php +++ b/lib/inboxnoticestream.php @@ -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); + } }