]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelineuser.php
Handle groups better in Ostatus_profile->updateAvatar
[quix0rs-gnu-social.git] / actions / apitimelineuser.php
index 97462452f22c0642453df81aedb56df3e2213fea..26c960fa0429b9e1d176713cd4e65e60be43ddfa 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));
@@ -224,7 +229,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
             break;
         default:
             // TRANS: Client error displayed when coming across a non-supported API method.
-            $this->clientError(_('API method not found.'), $code = 404);
+            $this->clientError(_('API method not found.'), 404);
         }
     }