]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use new stream class rather than old Notice::publicStream()
authorEvan Prodromou <evan@status.net>
Thu, 25 Aug 2011 15:50:45 +0000 (11:50 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 25 Aug 2011 15:50:45 +0000 (11:50 -0400)
actions/apitimelinepublic.php

index 47e253d5fd6124dbca30354fe747995b89a03ea2..b82e01aafe5658494544ab7f83b89bfe9a130a3d 100644 (file)
@@ -258,14 +258,18 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
     {
         $notices = array();
 
-        $notice = Notice::publicStream(
-            ($this->page - 1) * $this->count, $this->count, $this->since_id,
-            $this->max_id
-        );
+        $profile = ($this->auth_user) ? $this->auth_user->getProfile() : null;
 
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
+        $stream = new PublicNoticeStream($profile);
+
+        $notice = $stream->getNotices(($this->page - 1) * $this->count,
+                                      $this->count,
+                                      $this->since_id,
+                                      $this->max_id);
+
+        $notices = $notice->fetchAll();
+
+        NoticeList::prefill($notices);
 
         return $notices;
     }