diff options
author | Evan Prodromou <evan@status.net> | 2010-01-16 07:48:59 -0800 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-16 07:48:59 -0800 |
commit | 21c3e08804b312aaea21ae6bd0a0691304d6e4cd (patch) | |
tree | 9a950feabe17cd52e241eddf06d61409a190bba6 /classes/Inbox.php | |
parent | d6b8b13116b9a2de5d745487277551b281796975 (diff) | |
parent | 598072468c9fdb07df2cda9da207f123b14566ae (diff) |
Merge branch 'master' of git@gitorious.org:statusnet/mainline
Diffstat (limited to 'classes/Inbox.php')
-rw-r--r-- | classes/Inbox.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/classes/Inbox.php b/classes/Inbox.php index 312b4586b..086dba1c9 100644 --- a/classes/Inbox.php +++ b/classes/Inbox.php @@ -154,17 +154,23 @@ class Inbox extends Memcached_DataObject $ids = unpack('N*', $inbox->notice_ids); if (!empty($since_id)) { - $i = array_search($since_id, $ids); - if ($i !== false) { - $ids = array_slice($ids, 0, $i - 1); + $newids = array(); + foreach ($ids as $id) { + if ($id > $since_id) { + $newids[] = $id; + } } + $ids = $newids; } if (!empty($max_id)) { - $i = array_search($max_id, $ids); - if ($i !== false) { - $ids = array_slice($ids, $i - 1); + $newids = array(); + foreach ($ids as $id) { + if ($id <= $max_id) { + $newids[] = $id; + } } + $ids = $newids; } $ids = array_slice($ids, $offset, $limit); |