Browse Source

Update AccountController, include account entities in follow_requests.json endpoint

Daniel Supernault 3 years ago
parent
commit
aded149fae

+ 1 - 1
app/Http/Controllers/AccountController.php

@@ -370,7 +370,7 @@ class AccountController extends Controller
 					'avatar' => $actor->avatarUrl(),
 					'url' => $actor->url(),
 					'local' => $actor->domain == null,
-					'following' => $actor->followedBy(Auth::user()->profile)
+					'account' => AccountService::get($actor->id)
 				];
 			})
 		];

+ 2 - 2
app/Http/Controllers/Api/ApiV1Controller.php

@@ -442,7 +442,7 @@ class ApiV1Controller extends Controller
 
 		if($pid != $account['id']) {
 			if($account['locked']) {
-				if(FollowerService::follows($pid, $account['id'])) {
+				if(!FollowerService::follows($pid, $account['id'])) {
 					return [];
 				}
 			}
@@ -489,7 +489,7 @@ class ApiV1Controller extends Controller
 
 		if($pid != $account['id']) {
 			if($account['locked']) {
-				if(FollowerService::follows($pid, $account['id'])) {
+				if(!FollowerService::follows($pid, $account['id'])) {
 					return [];
 				}
 			}

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

@@ -738,7 +738,7 @@ class PublicApiController extends Controller
 
 		if($pid != $account['id']) {
 			if($account['locked']) {
-				if(FollowerService::follows($pid, $account['id'])) {
+				if(!FollowerService::follows($pid, $account['id'])) {
 					return [];
 				}
 			}
@@ -778,7 +778,7 @@ class PublicApiController extends Controller
 
 		if($pid != $account['id']) {
 			if($account['locked']) {
-				if(FollowerService::follows($pid, $account['id'])) {
+				if(!FollowerService::follows($pid, $account['id'])) {
 					return [];
 				}
 			}