mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update ApiV1Controller, fix favourited_by and reblogged_by follows attribute
This commit is contained in:
parent
831c062da8
commit
1a130f3e33
1 changed files with 12 additions and 4 deletions
|
@ -2519,8 +2519,13 @@ class ApiV1Controller extends Controller
|
|||
$headers = ['Link' => $links];
|
||||
}
|
||||
|
||||
$res = $res->map(function($status) {
|
||||
return AccountService::get($status->profile_id);
|
||||
$res = $res->map(function($status) use($user) {
|
||||
$account = AccountService::getMastodon($status->profile_id, true);
|
||||
if(!$account) {
|
||||
return false;
|
||||
}
|
||||
$account['follows'] = $status->profile_id == $user->profile_id ? null : FollowerService::follows($user->profile_id, $status->profile_id);
|
||||
return $account;
|
||||
})
|
||||
->filter(function($account) {
|
||||
return $account && isset($account['id']);
|
||||
|
@ -2594,9 +2599,12 @@ class ApiV1Controller extends Controller
|
|||
$headers = ['Link' => $links];
|
||||
}
|
||||
|
||||
$res = $res->map(function($like) {
|
||||
$res = $res->map(function($like) use($user) {
|
||||
$account = AccountService::getMastodon($like->profile_id, true);
|
||||
$account['follows'] = isset($like->created_at);
|
||||
if(!$account) {
|
||||
return false;
|
||||
}
|
||||
$account['follows'] = $like->profile_id == $user->profile_id ? null : FollowerService::follows($user->profile_id, $like->profile_id);
|
||||
return $account;
|
||||
})
|
||||
->filter(function($account) use($user) {
|
||||
|
|
Loading…
Reference in a new issue