diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 0a2b88c2e..27aebedea 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1426,6 +1426,8 @@ class ApiV1Controller extends Controller $status['favourited'] = true; $status['favourites_count'] = $status['favourites_count'] + 1; + $status['bookmarked'] = BookmarkService::get($user->profile_id, $status['id']); + $status['reblogged'] = ReblogService::get($user->profile_id, $status['id']); return $this->json($status); } @@ -1484,6 +1486,8 @@ class ApiV1Controller extends Controller $status['favourited'] = false; $status['favourites_count'] = isset($ogStatus) ? $ogStatus->likes_count : $status['favourites_count'] - 1; + $status['bookmarked'] = BookmarkService::get($user->profile_id, $status['id']); + $status['reblogged'] = ReblogService::get($user->profile_id, $status['id']); return $this->json($status); } @@ -3490,7 +3494,7 @@ class ApiV1Controller extends Controller return []; } - $content = $request->filled('status') ? strip_tags(Purify::clean($request->input('status'))) : null; + $content = $request->filled('status') ? strip_tags($request->input('status')) : null; $cw = $user->profile->cw == true ? true : $request->boolean('sensitive', false); $spoilerText = $cw && $request->filled('spoiler_text') ? $request->input('spoiler_text') : null; @@ -3695,6 +3699,8 @@ class ApiV1Controller extends Controller ReblogService::add($user->profile_id, $status->id); $res = StatusService::getMastodon($status->id); $res['reblogged'] = true; + $res['favourited'] = LikeService::liked($user->profile_id, $status->id); + $res['bookmarked'] = BookmarkService::get($user->profile_id, $status->id); return $this->json($res); } @@ -3741,6 +3747,8 @@ class ApiV1Controller extends Controller $res = StatusService::getMastodon($status->id); $res['reblogged'] = false; + $res['favourited'] = LikeService::liked($user->profile_id, $status->id); + $res['bookmarked'] = BookmarkService::get($user->profile_id, $status->id); return $this->json($res); }