X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelineuser.php;fp=actions%2Fapitimelineuser.php;h=81b8fcc88f3c5856e1bae420444a8639d42de904;hb=996345088e8d57cf39fa38129ab50ff02918a275;hp=382600348f716a671019c58ccd00b746e429d0f6;hpb=f2bfcdc2c1d7bc4634bb06285380884a57075759;p=quix0rs-gnu-social.git diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index 382600348f..81b8fcc88f 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -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; }