Skip to content

Commit 3f4e0b9

Browse files
committed
Update ApiV1Controller, add settings to verify_credentials endpoint
1 parent 42915ff commit 3f4e0b9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app/Http/Controllers/Api/ApiV1Controller.php

+16
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,22 @@ public function verifyCredentials(Request $request)
193193
'fields' => [],
194194
];
195195

196+
if ($request->has(self::PF_API_ENTITY_KEY)) {
197+
$settings = $user->settings;
198+
$other = array_merge(AccountService::defaultSettings()['other'], $settings->other ?? []);
199+
$res['settings'] = [
200+
'reduce_motion' => (bool) $settings->reduce_motion,
201+
'high_contrast_mode' => (bool) $settings->high_contrast_mode,
202+
'video_autoplay' => (bool) $settings->video_autoplay,
203+
'media_descriptions' => (bool) $settings->media_descriptions,
204+
'crawlable' => (bool) $settings->crawlable,
205+
'show_profile_follower_count' => (bool) $settings->show_profile_follower_count,
206+
'show_profile_following_count' => (bool) $settings->show_profile_following_count,
207+
'public_dm' => (bool) $settings->public_dm,
208+
'disable_embeds' => (bool) $other['disable_embeds'],
209+
];
210+
}
211+
196212
return $this->json($res);
197213
}
198214

0 commit comments

Comments
 (0)