From: Hank G Date: Sun, 12 Mar 2023 15:43:59 +0000 (-0400) Subject: Apply suggestions from code review X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a6e9f9c89e7716e969e9958ba761195e3fefb864;p=friendica.git Apply suggestions from code review Co-authored-by: Hypolite Petovan --- diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index bf5c9aa6a2..64fba420dd 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -78,14 +78,14 @@ class Statuses extends BaseApi $item['language'] = json_encode([$request['language'] => 1]); } - if ($post['gravity'] == 0) { + if ($post['gravity'] == Item::GRAVITY_PARENT) { $item['title'] = $request['friendica']['title'] ?? ''; } $spoiler_text = $request['spoiler_text']; if (!empty($spoiler_text)) { - if (!isset($request['friendica']['title']) && $post['gravity'] == 0 && DI::pConfig()->get($uid, 'system', 'api_spoiler_title', true)) { + if (!isset($request['friendica']['title']) && $post['gravity'] == Item::GRAVITY_PARENT && DI::pConfig()->get($uid, 'system', 'api_spoiler_title', true)) { $item['title'] = $spoiler_text; } else { $item['body'] = '[abstract=' . Protocol::ACTIVITYPUB . ']' . $spoiler_text . "[/abstract]\n" . $item['body'];