]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/all.php
Revert "Return a 404 when a page is request that has no notices"
[quix0rs-gnu-social.git] / actions / all.php
index 38aee65b64c0c7c85148cdd3dba243ebde124334..5db09a0e619a12885c0a074c6d9a38d009b255b6 100644 (file)
@@ -25,31 +25,11 @@ require_once INSTALLDIR.'/lib/feedlist.php';
 
 class AllAction extends ProfileAction
 {
-    var $notice;
-
     function isReadOnly($args)
     {
         return true;
     }
 
-    function prepare($args)
-    {
-        parent::prepare($args);
-        $cur = common_current_user();
-
-        if (!empty($cur) && $cur->id == $this->user->id) {
-            $this->notice = $this->user->noticeInbox(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
-        } else {
-            $this->notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
-        }
-
-        if($this->page > 1 && $this->notice->N == 0){
-            $this->serverError(_('No such page'),$code=404);
-        }
-
-        return true;
-    }
-
     function handle($args)
     {
         parent::handle($args);
@@ -120,7 +100,15 @@ class AllAction extends ProfileAction
 
     function showContent()
     {
-        $nl = new NoticeList($this->notice, $this);
+        $cur = common_current_user();
+
+        if (!empty($cur) && $cur->id == $this->user->id) {
+            $notice = $this->user->noticeInbox(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+        } else {
+            $notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+        }
+
+        $nl = new NoticeList($notice, $this);
 
         $cnt = $nl->show();