From 3f4e0b94ee0823afefbb3535ed8d7c2ed762831b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 2 Jun 2024 17:57:31 -0600 Subject: [PATCH] Update ApiV1Controller, add settings to verify_credentials endpoint --- app/Http/Controllers/Api/ApiV1Controller.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 34fb256f1..3de3773e2 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -193,6 +193,22 @@ class ApiV1Controller extends Controller '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); }