mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update ApiV1Controller, add settings to verify_credentials endpoint
This commit is contained in:
parent
42915ff9a0
commit
3f4e0b94ee
1 changed files with 16 additions and 0 deletions
|
@ -193,6 +193,22 @@ class ApiV1Controller extends Controller
|
||||||
'fields' => [],
|
'fields' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($request->has(self::PF_API_ENTITY_KEY)) {
|
||||||
|
$settings = $user->settings;
|
||||||
|
$other = array_merge(AccountService::defaultSettings()['other'], $settings->other ?? []);
|
||||||
|
$res['settings'] = [
|
||||||
|
'reduce_motion' => (bool) $settings->reduce_motion,
|
||||||
|
'high_contrast_mode' => (bool) $settings->high_contrast_mode,
|
||||||
|
'video_autoplay' => (bool) $settings->video_autoplay,
|
||||||
|
'media_descriptions' => (bool) $settings->media_descriptions,
|
||||||
|
'crawlable' => (bool) $settings->crawlable,
|
||||||
|
'show_profile_follower_count' => (bool) $settings->show_profile_follower_count,
|
||||||
|
'show_profile_following_count' => (bool) $settings->show_profile_following_count,
|
||||||
|
'public_dm' => (bool) $settings->public_dm,
|
||||||
|
'disable_embeds' => (bool) $other['disable_embeds'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return $this->json($res);
|
return $this->json($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue