]> git.mxchange.org Git - friendica.git/commitdiff
Apply suggestions from code review
authorHank G <hankgrabowski@gmail.com>
Sun, 12 Mar 2023 15:43:59 +0000 (11:43 -0400)
committerGitHub <noreply@github.com>
Sun, 12 Mar 2023 15:43:59 +0000 (11:43 -0400)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
src/Module/Api/Mastodon/Statuses.php

index bf5c9aa6a2523209aa333e414683e436b75e4e42..64fba420ddaaae50b879b650cd5fe434e3919f1e 100644 (file)
@@ -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'];