]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Reply.php
Annihilate profile_tag_inbox.
[quix0rs-gnu-social.git] / classes / Reply.php
index dc6296bda347b9f78e8e31fa856a5f1c7681670c..9ba623ba3fea630d9f8a3fb76e5265dbf5f3a2fb 100644 (file)
@@ -38,40 +38,8 @@ class Reply extends Memcached_DataObject
 
     function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
     {
-        $ids = Notice::stream(array('Reply', '_streamDirect'),
-                              array($user_id),
-                              'reply:stream:' . $user_id,
-                              $offset, $limit, $since_id, $max_id);
-        return $ids;
-    }
-
-    function _streamDirect($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
-    {
-        $reply = new Reply();
-        $reply->profile_id = $user_id;
-
-        if ($since_id != 0) {
-            $reply->whereAdd('notice_id > ' . $since_id);
-        }
-
-        if ($max_id != 0) {
-            $reply->whereAdd('notice_id < ' . $max_id);
-        }
-
-        $reply->orderBy('notice_id DESC');
-
-        if (!is_null($offset)) {
-            $reply->limit($offset, $limit);
-        }
-
-        $ids = array();
-
-        if ($reply->find()) {
-            while ($reply->fetch()) {
-                $ids[] = $reply->notice_id;
-            }
-        }
+        $stream = new ReplyNoticeStream($user_id);
 
-        return $ids;
+        return $stream->getNotices($offset, $limit, $since_id, $max_id);
     }
 }