]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Squashed commit of the following:
authorEvan Prodromou <evan@status.net>
Tue, 3 Apr 2012 21:15:58 +0000 (17:15 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 3 Apr 2012 21:16:18 +0000 (17:16 -0400)
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

lib/inboxnoticestream.php

index 5517cef1137b4bcfddb3033a59c0611efc5dbb9c..58b007505084baa76ab557c23d48249ff69406c4 100644 (file)
@@ -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);
+    }
 }