]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelineuser.php
Merge branch 'master' of gitorious.org:social/mainline into social-master
[quix0rs-gnu-social.git] / actions / apitimelineuser.php
index 382600348f716a671019c58ccd00b746e429d0f6..81b8fcc88f3c5856e1bae420444a8639d42de904 100644 (file)
@@ -134,12 +134,17 @@ class ApiTimelineUserAction extends ApiBareAuthAction
                                           'id' => $this->target->id),
                                     array('max_id' => $this->next_id))
                     : null;
-        $lastNotice = $this->notices[0];
-        $lastId     = $lastNotice->id;
+
+        $prevExtra = array();
+        if (!empty($this->notices)) {
+            assert($this->notices[0] instanceof Notice);
+            $prevExtra['since_id'] = $this->notices[0]->id;
+        }
+
         $prevUrl = common_local_url('ApiTimelineUser',
                                     array('format' => $this->format,
                                           'id' => $this->target->id),
-                                    array('since_id' => $lastId));
+                                    $prevExtra);
         $firstUrl = common_local_url('ApiTimelineUser',
                                     array('format' => $this->format,
                                           'id' => $this->target->id));
@@ -252,11 +257,6 @@ class ApiTimelineUserAction extends ApiBareAuthAction
             }
         }
 
-        if (empty($notices)) {
-            // TRANS: When no posts were found with specific or default parameters
-            $this->clientError(_('Did not find any posts within search parameters'), 404);
-        }
-
         return $notices;
     }