瀏覽代碼

Update PublicApiController, fix private account statuses api. Closes #2995

Daniel Supernault 3 年之前
父節點
當前提交
aa2dd26c1b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/Http/Controllers/PublicApiController.php

+ 2 - 1
app/Http/Controllers/PublicApiController.php

@@ -382,6 +382,7 @@ class PublicApiController extends Controller
 			->filter(function($s) use($filtered) {
 				return in_array($s['account']['id'], $filtered) == false;
 			})
+			->values()
 			->toArray();
         }
 
@@ -734,7 +735,7 @@ class PublicApiController extends Controller
                 $following = Follower::whereProfileId($pid)->pluck('following_id');
                 return $following->push($pid)->toArray();
             });
-            $visibility = true == in_array($profile->id, $following) ? ['public', 'unlisted', 'private'] : [];
+            $visibility = true == in_array($profile['id'], $following) ? ['public', 'unlisted', 'private'] : [];
         } else {
             if($user) {
                 $pid = $user->profile_id;