]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/all.php
Merge remote branch 'origin/1.0.x' into 1.0.x
[quix0rs-gnu-social.git] / actions / all.php
index 2826319c0d9e59ffc56c0de40e9d561efdc418f0..5fd2475e4911f3b467a8836cfba87b92a63cdc36 100644 (file)
@@ -55,17 +55,17 @@ class AllAction extends ProfileAction
     function prepare($args)
     {
         parent::prepare($args);
-        $cur = common_current_user();
 
-        if (!empty($cur) && $cur->id == $this->user->id) {
-            $this->notice = $this->user->noticeInboxThreaded(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
-        } else {
-            $this->notice = $this->user->noticesWithFriendsThreaded(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
-        }
+        $stream = new InboxNoticeStream($this->user);
+
+        $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+                                            NOTICES_PER_PAGE + 1,
+                                            null,
+                                            null);
 
         if ($this->page > 1 && $this->notice->N == 0) {
             // TRANS: Server error when page not found (404).
-            $this->serverError(_('No such page.'), $code = 404);
+            $this->serverError(_('No such page.'), 404);
         }
 
         return true;
@@ -157,7 +157,16 @@ class AllAction extends ProfileAction
     function showContent()
     {
         if (Event::handle('StartShowAllContent', array($this))) {
-            $nl = new ThreadedNoticeList($this->notice, $this);
+
+            $profile = null;
+
+            $current_user = common_current_user();
+
+            if (!empty($current_user)) {
+                $profile = $current_user->getProfile();
+            }
+
+            $nl = new ThreadedNoticeList($this->notice, $this, $profile);
 
             $cnt = $nl->show();