diff options
author | Brion Vibber <brion@pobox.com> | 2010-01-15 09:52:50 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-01-15 09:52:50 -0800 |
commit | ef016dca45b17e7a9e8aae17ffe1b5caf0e2694c (patch) | |
tree | 3fe3b0a03aa1034d03618167432481f321804138 /classes | |
parent | a27aef92060277120f8889136ed6972f5915709f (diff) | |
parent | 038287c1ffb71207f8028014f20005483364956d (diff) |
Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Inbox.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/classes/Inbox.php b/classes/Inbox.php index 83cfe8ef8..312b4586b 100644 --- a/classes/Inbox.php +++ b/classes/Inbox.php @@ -103,9 +103,9 @@ class Inbox extends Memcached_DataObject static function insertNotice($user_id, $notice_id) { - $inbox = Inbox::staticGet('user_id', $user_id); + $inbox = DB_DataObject::staticGet('inbox', 'user_id', $user_id); - if (empty($inbox) || $inbox->fake) { + if (empty($inbox)) { $inbox = Inbox::initialize($user_id); } @@ -153,8 +153,19 @@ class Inbox extends Memcached_DataObject $ids = unpack('N*', $inbox->notice_ids); - // XXX: handle since_id - // XXX: handle max_id + if (!empty($since_id)) { + $i = array_search($since_id, $ids); + if ($i !== false) { + $ids = array_slice($ids, 0, $i - 1); + } + } + + if (!empty($max_id)) { + $i = array_search($max_id, $ids); + if ($i !== false) { + $ids = array_slice($ids, $i - 1); + } + } $ids = array_slice($ids, $offset, $limit); |