]> git.mxchange.org Git - friendica.git/commitdiff
Move System::jsonExit to BaseModule->jsonExit
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 21 Sep 2023 16:16:17 +0000 (12:16 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 24 Sep 2023 11:08:15 +0000 (07:08 -0400)
- This will ensure headers set in BaseModule->run will be carried in jsonExit scenarios
- Deprecate jsonExit() method in Core\System

119 files changed:
src/BaseModule.php
src/Core/System.php
src/Module/AccountManagementControlDocument.php
src/Module/ActivityPub/Featured.php
src/Module/ActivityPub/Followers.php
src/Module/ActivityPub/Following.php
src/Module/ActivityPub/Inbox.php
src/Module/ActivityPub/Objects.php
src/Module/ActivityPub/Outbox.php
src/Module/ActivityPub/Whoami.php
src/Module/Api/Friendica/Statuses/Dislike.php
src/Module/Api/Friendica/Statuses/DislikedBy.php
src/Module/Api/Friendica/Statuses/Undislike.php
src/Module/Api/Mastodon/Accounts.php
src/Module/Api/Mastodon/Accounts/Block.php
src/Module/Api/Mastodon/Accounts/FeaturedTags.php
src/Module/Api/Mastodon/Accounts/Follow.php
src/Module/Api/Mastodon/Accounts/Followers.php
src/Module/Api/Mastodon/Accounts/Following.php
src/Module/Api/Mastodon/Accounts/IdentityProofs.php
src/Module/Api/Mastodon/Accounts/Lists.php
src/Module/Api/Mastodon/Accounts/Mute.php
src/Module/Api/Mastodon/Accounts/Note.php
src/Module/Api/Mastodon/Accounts/Relationships.php
src/Module/Api/Mastodon/Accounts/Search.php
src/Module/Api/Mastodon/Accounts/Statuses.php
src/Module/Api/Mastodon/Accounts/Unblock.php
src/Module/Api/Mastodon/Accounts/Unfollow.php
src/Module/Api/Mastodon/Accounts/Unmute.php
src/Module/Api/Mastodon/Announcements.php
src/Module/Api/Mastodon/Apps.php
src/Module/Api/Mastodon/Apps/VerifyCredentials.php
src/Module/Api/Mastodon/Blocks.php
src/Module/Api/Mastodon/Bookmarks.php
src/Module/Api/Mastodon/Conversations.php
src/Module/Api/Mastodon/Conversations/Read.php
src/Module/Api/Mastodon/CustomEmojis.php
src/Module/Api/Mastodon/Directory.php
src/Module/Api/Mastodon/Endorsements.php
src/Module/Api/Mastodon/Favourited.php
src/Module/Api/Mastodon/Filters.php
src/Module/Api/Mastodon/FollowRequests.php
src/Module/Api/Mastodon/FollowedTags.php
src/Module/Api/Mastodon/Instance.php
src/Module/Api/Mastodon/Instance/Peers.php
src/Module/Api/Mastodon/Instance/Rules.php
src/Module/Api/Mastodon/InstanceV2.php
src/Module/Api/Mastodon/Lists.php
src/Module/Api/Mastodon/Lists/Accounts.php
src/Module/Api/Mastodon/Markers.php
src/Module/Api/Mastodon/Media.php
src/Module/Api/Mastodon/Mutes.php
src/Module/Api/Mastodon/Notifications.php
src/Module/Api/Mastodon/Notifications/Clear.php
src/Module/Api/Mastodon/Notifications/Dismiss.php
src/Module/Api/Mastodon/Polls.php
src/Module/Api/Mastodon/Preferences.php
src/Module/Api/Mastodon/Reports.php
src/Module/Api/Mastodon/ScheduledStatuses.php
src/Module/Api/Mastodon/Search.php
src/Module/Api/Mastodon/Statuses.php
src/Module/Api/Mastodon/Statuses/Bookmark.php
src/Module/Api/Mastodon/Statuses/Card.php
src/Module/Api/Mastodon/Statuses/Context.php
src/Module/Api/Mastodon/Statuses/Favourite.php
src/Module/Api/Mastodon/Statuses/FavouritedBy.php
src/Module/Api/Mastodon/Statuses/Mute.php
src/Module/Api/Mastodon/Statuses/Pin.php
src/Module/Api/Mastodon/Statuses/Reblog.php
src/Module/Api/Mastodon/Statuses/RebloggedBy.php
src/Module/Api/Mastodon/Statuses/Source.php
src/Module/Api/Mastodon/Statuses/Unbookmark.php
src/Module/Api/Mastodon/Statuses/Unfavourite.php
src/Module/Api/Mastodon/Statuses/Unmute.php
src/Module/Api/Mastodon/Statuses/Unpin.php
src/Module/Api/Mastodon/Statuses/Unreblog.php
src/Module/Api/Mastodon/Suggestions.php
src/Module/Api/Mastodon/Tags.php
src/Module/Api/Mastodon/Tags/Follow.php
src/Module/Api/Mastodon/Tags/Unfollow.php
src/Module/Api/Mastodon/Timelines/Direct.php
src/Module/Api/Mastodon/Timelines/Home.php
src/Module/Api/Mastodon/Timelines/ListTimeline.php
src/Module/Api/Mastodon/Timelines/PublicTimeline.php
src/Module/Api/Mastodon/Timelines/Tag.php
src/Module/Api/Mastodon/Trends/Links.php
src/Module/Api/Mastodon/Trends/Statuses.php
src/Module/Api/Mastodon/Trends/Tags.php
src/Module/Api/Twitter/Blocks/Ids.php
src/Module/Api/Twitter/Followers/Ids.php
src/Module/Api/Twitter/Friends/Ids.php
src/Module/BaseNotifications.php
src/Module/Calendar/Event/Get.php
src/Module/Circle.php
src/Module/Friendica.php
src/Module/Hashtag.php
src/Module/Item/Activity.php
src/Module/Item/Follow.php
src/Module/Item/Ignore.php
src/Module/Item/Pin.php
src/Module/Item/Star.php
src/Module/Manifest.php
src/Module/NoScrape.php
src/Module/Notifications/Notification.php
src/Module/Notifications/Ping.php
src/Module/OAuth/Revoke.php
src/Module/OAuth/Token.php
src/Module/Owa.php
src/Module/ParseUrl.php
src/Module/Profile/Profile.php
src/Module/Search/Acl.php
src/Module/Search/Tags.php
src/Module/Smilies.php
src/Module/Statistics.php
src/Module/ThemeDetails.php
src/Module/User/PortableContacts.php
src/Module/WellKnown/NodeInfo.php
src/Module/WellKnown/XSocialRelay.php
src/Module/Xrd.php

index 5ebeec3c8099d6064d22d5d9476a923817ec4e02..463954f000935d21b0a6bd1caf8f1044ceae27c3 100644 (file)
@@ -495,4 +495,19 @@ abstract class BaseModule implements ICanHandleRequests
 
                $this->httpExit($content);
        }
+
+       /**
+        * Display the response using JSON to encode the content
+        *
+        * @param mixed  $content
+        * @param string $content_type
+        * @param int    $options A combination of json_encode() binary flags
+        * @return void
+        * @throws HTTPException\InternalServerErrorException
+        * @see json_encode()
+        */
+       public function jsonExit($content, string $content_type = 'application/json', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
+       {
+               $this->httpExit(json_encode($content, $options), ICanCreateResponses::TYPE_JSON, $content_type);
+       }
 }
index 48a4ce614168ad0eadf3c1a0ad493ce12b12a157..6af4186a37ae0f3ae51188ebcb97f99615de6ea4 100644 (file)
@@ -392,14 +392,12 @@ class System
         * @param mixed   $content      The input content
         * @param string  $content_type Type of the input (Default: 'application/json')
         * @param integer $options      JSON options
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws InternalServerErrorException
+        * @deprecated since 2023.09 Use BaseModule->jsonExit instead
         */
-       public static function jsonExit($content, $content_type = 'application/json', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) {
-               DI::apiResponse()->setType(Response::TYPE_JSON, $content_type);
-               DI::apiResponse()->addContent(json_encode($content, $options));
-               self::echoResponse(DI::apiResponse()->generate());
-
-               self::exit();
+       public static function jsonExit($content, string $content_type = 'application/json', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
+       {
+               self::httpExit(json_encode($content, $options), Response::TYPE_JSON, $content_type);
        }
 
        /**
index 4f015e45b28b4b1264e726c29b779b982a4c1998..19cb4582265e4e7d3d5c28445317dbc9c01b3eab 100644 (file)
@@ -79,6 +79,6 @@ class AccountManagementControlDocument extends BaseModule
                        ],
                ];
 
-               System::jsonExit($output);
+               $this->jsonExit($output);
        }
 }
index 8e97097182037592759a047a6b722a4b041e8fac..57934cf3302068b7cb3cbdbf99aed25626c7cf6e 100644 (file)
@@ -46,6 +46,6 @@ class Featured extends BaseModule
 
                $featured = ActivityPub\Transmitter::getFeatured($owner, $page);
 
-               System::jsonExit($featured, 'application/activity+json');
+               $this->jsonExit($featured, 'application/activity+json');
        }
 }
index 1b9bdbb0f2bb6e5f0cefc356256a50a4580b4956..8bcb2a8996b2153cd5f8fd68f2ceb44bdcc8ee34 100644 (file)
@@ -49,6 +49,6 @@ class Followers extends BaseModule
 
                $followers = ActivityPub\Transmitter::getContacts($owner, [Contact::FOLLOWER, Contact::FRIEND], 'followers', $page, (string)HTTPSignature::getSigner('', $_SERVER));
 
-               System::jsonExit($followers, 'application/activity+json');
+               $this->jsonExit($followers, 'application/activity+json');
        }
 }
index ae2709611798fc0ead0e1d7967de35fed4fb1082..1fc5eefd7b3c3066d5485cf156bab28c65488dcf 100644 (file)
@@ -47,6 +47,6 @@ class Following extends BaseModule
 
                $following = ActivityPub\Transmitter::getContacts($owner, [Contact::SHARING, Contact::FRIEND], 'following', $page);
 
-               System::jsonExit($following, 'application/activity+json');
+               $this->jsonExit($following, 'application/activity+json');
        }
 }
index 77085c119a346ff116209ef8c027f22764608db6..10e4c9db04cec2542707e7266d02932d24068f01 100644 (file)
@@ -66,7 +66,7 @@ class Inbox extends BaseApi
                        $inbox = ActivityPub\ClientToServer::getPublicInbox($uid, $page, $request['max_id'] ?? null);
                }
 
-               System::jsonExit($inbox, 'application/activity+json');
+               $this->jsonExit($inbox, 'application/activity+json');
        }
 
        protected function post(array $request = [])
index 34d4609511447a577b32b413badac788dd331ed6..bbb008690989283816f8b425eff4c9f78e14152f 100644 (file)
@@ -130,6 +130,6 @@ class Objects extends BaseModule
                // Relaxed CORS header for public items
                header('Access-Control-Allow-Origin: *');
 
-               System::jsonExit($data, 'application/activity+json');
+               $this->jsonExit($data, 'application/activity+json');
        }
 }
index 492971bba073e27f068ba56569cb6c071ee935f2..3dc0f00e74423086c5244106c414e04d838f3dd6 100644 (file)
@@ -53,7 +53,7 @@ class Outbox extends BaseApi
 
                $outbox = ActivityPub\ClientToServer::getOutbox($owner, $uid, $page, $request['max_id'] ?? null, HTTPSignature::getSigner('', $_SERVER));
 
-               System::jsonExit($outbox, 'application/activity+json');
+               $this->jsonExit($outbox, 'application/activity+json');
        }
 
        protected function post(array $request = [])
@@ -79,6 +79,6 @@ class Outbox extends BaseApi
                        throw new \Friendica\Network\HTTPException\BadRequestException();
                }
 
-               System::jsonExit(ActivityPub\ClientToServer::processActivity($activity, $uid, self::getCurrentApplication() ?? []));
+               $this->jsonExit(ActivityPub\ClientToServer::processActivity($activity, $uid, self::getCurrentApplication() ?? []));
        }
 }
index cac21744f897d96168c8127829365e6496500c5b..67128d99c153e2c842336cf5651c9de2cfb6ef7e 100644 (file)
@@ -100,6 +100,6 @@ class Whoami extends BaseApi
                ];
 
                $data['generator'] = ActivityPub\Transmitter::getService();
-               System::jsonExit($data, 'application/activity+json');
+               $this->jsonExit($data, 'application/activity+json');
        }
 }
index e9690d4858266ac0e0b6e83d2ad4c9e4f480d9ff..01bfeba90c6b8142281b51f7ed6f3f7af4dabafe 100644 (file)
@@ -49,6 +49,6 @@ class Dislike extends BaseApi
 
                Item::performActivity($item['id'], 'dislike', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes())->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes())->toArray());
        }
 }
index 81860bc40c543581ae88988fd531cb996256fc2c..bb788848372efbb61c6d5183d48abd2a14766b7c 100644 (file)
@@ -57,6 +57,6 @@ class DislikedBy extends BaseApi
                        $accounts[] = DI::mstdnAccount()->createFromContactId($activity['author-id'], $uid);
                }
 
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 933d7a1ed57b0bc2ea5b57d85c6e9250668e4598..4ede1fd945a809670df41bee6095fc91a09a5ad3 100644 (file)
@@ -49,6 +49,6 @@ class Undislike extends BaseApi
 
                Item::performActivity($item['id'], 'undislike', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes())->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes())->toArray());
        }
 }
index 72dac3749fe14e4656d462bb9bd1a86e2440ae3f..bd215e38734874609af20bbbf76d904e9c9f71af 100644 (file)
@@ -58,6 +58,6 @@ class Accounts extends BaseApi
                }
 
                $account = DI::mstdnAccount()->createFromContactId($id, $uid);
-               System::jsonExit($account);
+               $this->jsonExit($account);
        }
 }
index e13a8b2ff427cdf50c4688c7cc104d0449f10641..c4afb74a3e13f0c600a4bf3add0a197cab31b79d 100644 (file)
@@ -52,6 +52,6 @@ class Block extends BaseApi
                        }
                }
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
+               $this->jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index f8687ce9a9764d114563690616a9118d2e446d67..52c0c2831f02bc64e5ae8682dfa4aed7b5ca61ff 100644 (file)
@@ -36,6 +36,6 @@ class FeaturedTags extends BaseApi
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index c19ac3647666b540e6ee67ea78310c92937a6212..ad290f5ab49926c759ec0d3660947d62c95f52a9 100644 (file)
@@ -54,6 +54,6 @@ class Follow extends BaseApi
 
                Contact::update(['notify_new_posts' => $request['notify']], ['id' => $result['cid']]);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($result['cid'], $uid)->toArray());
+               $this->jsonExit(DI::mstdnRelationship()->createFromContactId($result['cid'], $uid)->toArray());
        }
 }
index e73c48855ed341d414448a59ddf6c34c0af48c38..65c7ac42d03ed8e760b8771cd6f59c2b2b7a7a26 100644 (file)
@@ -115,6 +115,6 @@ class Followers extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 2aa0cad0570bf7c394fbedd623170c62a8f5ba2d..5da678d9d5bcc87aa394a41d47f99535708cd0b7 100644 (file)
@@ -115,6 +115,6 @@ class Following extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 8e2e7292b04d22c1171c718f064bf670b15353d3..ac2f2ab55e49cfad6c9e25a8317ec7510fd5feb5 100644 (file)
@@ -36,6 +36,6 @@ class IdentityProofs extends BaseApi
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index e34dd41370abc6cad514eaf1fce7941387d0ecd2..d39f790810171b46119132beb34086817cf48185 100644 (file)
@@ -60,6 +60,6 @@ class Lists extends BaseApi
                        DBA::close($circles);
                }
 
-               System::jsonExit($lists);
+               $this->jsonExit($lists);
        }
 }
index d5c708c779d9b2add52e7f315c53042073e4ff26..f08e48154389327b0d8775e95f3be70b430b4e80 100644 (file)
@@ -42,6 +42,6 @@ class Mute extends BaseApi
 
                Contact\User::setIgnored($this->parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
+               $this->jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index abf100f5434350430d5a205bcb10a69442690b03..fc7e72247854f535c4ead192a156acf7d27b09a0 100644 (file)
@@ -52,6 +52,6 @@ class Note extends BaseApi
 
                Contact::update(['info' => $request['comment']], ['id' => $cdata['user']]);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
+               $this->jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index 074daa95d109f0724af6984bd977af71a1b1f629..531fcadd18a6e2d74d34a87cc6c55f566abee8bc 100644 (file)
@@ -57,6 +57,6 @@ class Relationships extends BaseApi
                        $relationships[] = DI::mstdnRelationship()->createFromContactId($id, $uid);
                }
 
-               System::jsonExit($relationships);
+               $this->jsonExit($relationships);
        }
 }
index 5276161640c823d5c5011cafa12258375a185ea8..a4936092cec509823155f215e8774099f75f0878 100644 (file)
@@ -67,6 +67,6 @@ class Search extends BaseApi
                        DBA::close($contacts);
                }
 
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 4ee6ae66c2cd86d1fb2010e5d21b4fe6495e429f..93b642cd69d63ce43a8fa4ff8af03ef181648d3a 100644 (file)
@@ -122,6 +122,6 @@ class Statuses extends BaseApi
                }
 
                self::setLinkHeader($request['friendica_order'] != TimelineOrderByTypes::ID);
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index c67186908ae350d63a957ea9894fc807103b3c40..35b532012989334b6cefc3d5ea84501120498fc5 100644 (file)
@@ -42,6 +42,6 @@ class Unblock extends BaseApi
 
                Contact\User::setBlocked($this->parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
+               $this->jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index b67e92f61ccf822f3ba3120c4144013422e5cdb3..c4bc172006452adeab0885c7a0e8dffcadd90954 100644 (file)
@@ -49,6 +49,6 @@ class Unfollow extends BaseApi
 
                Contact::unfollow($contact);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
+               $this->jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index e3f90330442bf02d384569024f5481d683924735..a2cf9082031edb5c6ca30d6359b2f25e88f8001d 100644 (file)
@@ -42,6 +42,6 @@ class Unmute extends BaseApi
 
                Contact\User::setIgnored($this->parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
+               $this->jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
        }
 }
index f04660948f1c3233d9ec93222f8cead71147c2e8..8e05659474321b92862ec79cc4233c2ba025ae70 100644 (file)
@@ -37,6 +37,6 @@ class Announcements extends BaseApi
                self::checkAllowedScope(self::SCOPE_READ);
 
                // @todo Possibly use the message from the pageheader addon for this
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index 40314a1149370ae3c2f3a5bd90485c6b6bea8a5a..d51a8e7b0a9b9e09af1db5d9d8399de1f8e716ac 100644 (file)
@@ -66,7 +66,7 @@ class Apps extends BaseApi
 
                        if (!empty($request['redirect_uris']) && is_array($request['redirect_uris'])) {
                                $request['redirect_uris'] = $request['redirect_uris'][0];
-                       }       
+                       }
                }
 
                if (empty($request['client_name']) || empty($request['redirect_uris'])) {
@@ -95,6 +95,6 @@ class Apps extends BaseApi
                        DI::mstdnError()->InternalError();
                }
 
-               System::jsonExit(DI::mstdnApplication()->createFromApplicationId(DBA::lastInsertId())->toArray());
+               $this->jsonExit(DI::mstdnApplication()->createFromApplicationId(DBA::lastInsertId())->toArray());
        }
 }
index ef9c775c106c0cb000257f1c0de50ebba54f0f17..c21e1e438a08cfe20f0f2965a5f74b81898bd131 100644 (file)
@@ -39,6 +39,6 @@ class VerifyCredentials extends BaseApi
                        DI::mstdnError()->Unauthorized();
                }
 
-               System::jsonExit(DI::mstdnApplication()->createFromApplicationId($application['id']));
+               $this->jsonExit(DI::mstdnApplication()->createFromApplicationId($application['id']));
        }
 }
index 55e65b61966fe0988c234c8071b7fd1883530b75..1495b763576b8f65eadef854f112ec00e0993f92 100644 (file)
@@ -77,6 +77,6 @@ class Blocks extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 59cf7f54a299d786bff53e49069bdbad9bf2f56d..dab072b30754232e9bc12a18027591dd4df5d59e 100644 (file)
@@ -88,6 +88,6 @@ class Bookmarks extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index fa8804f54290912f13616272f4542a0563bee56a..abffff9ede5299dfa6101c43c64c62b877ca94dc 100644 (file)
@@ -43,7 +43,7 @@ class Conversations extends BaseApi
                DBA::delete('conv', ['id' => $this->parameters['id'], 'uid' => $uid]);
                DBA::delete('mail', ['convid' => $this->parameters['id'], 'uid' => $uid]);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 
        /**
@@ -95,6 +95,6 @@ class Conversations extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($conversations);
+               $this->jsonExit($conversations);
        }
 }
index c88daafd574100231fceb0a7981f17fae510db19..e8b101634f00f3aee24cd9c0a6db8848c57ffabe 100644 (file)
@@ -42,6 +42,6 @@ class Read extends BaseApi
 
                DBA::update('mail', ['seen' => true], ['convid' => $this->parameters['id'], 'uid' => $uid]);
 
-               System::jsonExit(DI::mstdnConversation()->createFromConvId($this->parameters['id'])->toArray());
+               $this->jsonExit(DI::mstdnConversation()->createFromConvId($this->parameters['id'])->toArray());
        }
 }
index 650e96cea3a29238d9f90ff3088b7cd565a65f81..96565587a3b400aa6c0d179ce4159189871476f0 100644 (file)
@@ -41,6 +41,6 @@ class CustomEmojis extends BaseApi
        {
                $emojis = DI::mstdnEmoji()->createCollectionFromSmilies(Smilies::getList());
 
-               System::jsonExit($emojis->getArrayCopy());
+               $this->jsonExit($emojis->getArrayCopy());
        }
 }
index 2e4726397c5cc1f4659522908d0a900364458aa0..4270350bd85263e3845082b9f0f4044c2f161187 100644 (file)
@@ -68,6 +68,6 @@ class Directory extends BaseApi
                }
                DBA::close($contacts);
 
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 40b41985a524f10111ef5584d613c6d4879ac95d..b09fbfae3ab8510269d776b23fe9cbf469e6514b 100644 (file)
@@ -34,6 +34,6 @@ class Endorsements extends BaseApi
         */
        protected function rawContent(array $request = [])
        {
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index 7829f37d706c61ef12831acc2ed55a7e00322cf4..56beb93be2216ddf02f28cd832dcf9d44f643c58 100644 (file)
@@ -90,6 +90,6 @@ class Favourited extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index 25feb9d879d8350b1c654bd7063db0a2742a49b1..3af93d24cbe033b1162dd54a2876de7ed41a22ed 100644 (file)
@@ -45,6 +45,6 @@ class Filters extends BaseApi
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index dfe3aadf336ac8af79bf5d972bb9b4bba903ecdd..78efa4819adadc68f8ab7f766bbf7ea257b8b8f3 100644 (file)
@@ -79,7 +79,7 @@ class FollowRequests extends BaseApi
                                throw new HTTPException\BadRequestException('Unexpected action parameter, expecting "authorize", "ignore" or "reject"');
                }
 
-               System::jsonExit($relationship);
+               $this->jsonExit($relationship);
        }
 
        /**
@@ -115,6 +115,6 @@ class FollowRequests extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 306f87323622c2d4ad5a7c414a17d9f6c0351b4b..9052290063cb1887f852ca8902cbaf1d861313a4 100644 (file)
@@ -77,6 +77,6 @@ class FollowedTags extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index aaa0bbf50311be3ca2e3683b4af6f42223603b26..bf968b638b3adc3c5b9b89a8407d003c661fab99 100644 (file)
@@ -59,6 +59,6 @@ class Instance extends BaseApi
         */
        protected function rawContent(array $request = [])
        {
-               System::jsonExit(new InstanceEntity($this->config, $this->baseUrl, $this->database, System::getRules()));
+               $this->jsonExit(new InstanceEntity($this->config, $this->baseUrl, $this->database, System::getRules()));
        }
 }
index b33f07b69f4786f0a2b23e57dbf0e247c1ac7e9d..fba59e00950948560ea42ff63cae7ab548cfee00 100644 (file)
@@ -52,6 +52,6 @@ class Peers extends BaseApi
                }
                DBA::close($instances);
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 61434479bd0d248bebf1c252b3946f3074680fd9..a48009f6a152b0e09e9362e34f47f10fd66b7c16 100644 (file)
@@ -38,6 +38,6 @@ class Rules extends BaseApi
         */
        protected function rawContent(array $request = [])
        {
-               System::jsonExit(System::getRules());
+               $this->jsonExit(System::getRules());
        }
 }
index bf5cbcfb5575dfc2d858af772493d285517afa93..64d0955629524a51418a0fc9745fc6e58b386247 100644 (file)
@@ -94,7 +94,7 @@ class InstanceV2 extends BaseApi
                $contact              = $this->buildContactInfo();
                $friendica_extensions = $this->buildFriendicaExtensionInfo();
                $rules                = System::getRules();
-               System::jsonExit(new InstanceEntity(
+               $this->jsonExit(new InstanceEntity(
                        $domain,
                        $title,
                        $version,
index a007c80d33ae04f4a79196bd3ad3280b76d5c431..296009cc083b381fb2c380e7699ba9261b1de92b 100644 (file)
@@ -48,7 +48,7 @@ class Lists extends BaseApi
                        DI::mstdnError()->InternalError();
                }
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 
        protected function post(array $request = [])
@@ -71,7 +71,7 @@ class Lists extends BaseApi
                        DI::mstdnError()->InternalError();
                }
 
-               System::jsonExit(DI::mstdnList()->createFromCircleId($id));
+               $this->jsonExit(DI::mstdnList()->createFromCircleId($id));
        }
 
        public function put(array $request = [])
@@ -111,6 +111,6 @@ class Lists extends BaseApi
                        $lists = DI::mstdnList()->createFromCircleId($id);
                }
 
-               System::jsonExit($lists);
+               $this->jsonExit($lists);
        }
 }
index 465f22a268b5bbd0658a7c0ce2d612788f81652b..2d202c34dad722848057d49628fc8eb1a3e552c4 100644 (file)
@@ -127,6 +127,6 @@ class Accounts extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index a00b0f83179235b532362c267b6c6a8489c4dd81..2f0a6b6b74534078b603e159cd0c989ff5897dae 100644 (file)
@@ -61,7 +61,7 @@ class Markers extends BaseApi
 
                $fields = ['last_read_id' => $last_read_id, 'version' => $version, 'updated_at' => DateTimeFormat::utcNow()];
                DBA::update('application-marker', $fields, $condition, true);
-               System::jsonExit($this->fetchTimelines($application['id'], $uid));
+               $this->jsonExit($this->fetchTimelines($application['id'], $uid));
        }
 
        /**
@@ -73,7 +73,7 @@ class Markers extends BaseApi
                $uid         = self::getCurrentUserID();
                $application = self::getCurrentApplication();
 
-               System::jsonExit($this->fetchTimelines($application['id'], $uid));
+               $this->jsonExit($this->fetchTimelines($application['id'], $uid));
        }
 
        private function fetchTimelines(int $application_id, int $uid)
index 921ebdaf780dc25f38df24638a0d4bd2225153b6..3fe8dfa3d86383c2c1168a7276048a902389ebe0 100644 (file)
@@ -58,7 +58,7 @@ class Media extends BaseApi
 
                Logger::info('Uploaded photo', ['media' => $media]);
 
-               System::jsonExit(DI::mstdnAttachment()->createFromPhoto($media['id']));
+               $this->jsonExit(DI::mstdnAttachment()->createFromPhoto($media['id']));
        }
 
        public function put(array $request = [])
@@ -87,12 +87,12 @@ class Media extends BaseApi
                                DI::mstdnError()->RecordNotFound();
                        }
                        Post\Media::updateById(['description' => $request['description']], $this->parameters['id']);
-                       System::jsonExit(DI::mstdnAttachment()->createFromId($this->parameters['id']));
+                       $this->jsonExit(DI::mstdnAttachment()->createFromId($this->parameters['id']));
                }
 
                Photo::update(['desc' => $request['description']], ['resource-id' => $photo['resource-id']]);
 
-               System::jsonExit(DI::mstdnAttachment()->createFromPhoto($this->parameters['id']));
+               $this->jsonExit(DI::mstdnAttachment()->createFromPhoto($this->parameters['id']));
        }
 
        /**
@@ -112,6 +112,6 @@ class Media extends BaseApi
                        DI::mstdnError()->RecordNotFound();
                }
 
-               System::jsonExit(DI::mstdnAttachment()->createFromPhoto($id));
+               $this->jsonExit(DI::mstdnAttachment()->createFromPhoto($id));
        }
 }
index 2190c397cc10948f225d4fbc3e52c7c468e4fc19..71c17cc5113f8f686232deba8907624a531b122e 100644 (file)
@@ -85,6 +85,6 @@ class Mutes extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 70ef068982e10e489b034bc47858cdbd997b8dfe..94247b80b6a886dd348fc91ae66efbacfca75f32 100644 (file)
@@ -48,7 +48,7 @@ class Notifications extends BaseApi
                        $id = $this->parameters['id'];
                        try {
                                $notification = DI::notification()->selectOneForUser($uid, ['id' => $id]);
-                               System::jsonExit(DI::mstdnNotification()->createFromNotification($notification, self::appSupportsQuotes()));
+                               $this->jsonExit(DI::mstdnNotification()->createFromNotification($notification, self::appSupportsQuotes()));
                        } catch (\Exception $e) {
                                DI::mstdnError()->RecordNotFound();
                        }
@@ -132,7 +132,7 @@ class Notifications extends BaseApi
 
                if ($request['summary']) {
                        $count = DI::notification()->countForUser($uid, $condition);
-                       System::jsonExit(['count' => $count]);
+                       $this->jsonExit(['count' => $count]);
                } else {
                        $mstdnNotifications = [];
 
@@ -154,7 +154,7 @@ class Notifications extends BaseApi
                        }
 
                        self::setLinkHeader();
-                       System::jsonExit($mstdnNotifications);
+                       $this->jsonExit($mstdnNotifications);
                }
        }
 }
index 848bf46fb3cf887f1bb1dc7ba1f212f628a78881..cb2604337cb0aaf1146eb9cb5f8072e6ce0b7779 100644 (file)
@@ -37,6 +37,6 @@ class Clear extends BaseApi
 
                DI::notification()->setAllDismissedForUser($uid);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index 2b774c59e2cf8c68ecad45bfdac02bebfd91fb60..753c0ac5dcf733cba473a1f35e3b499240a4b865 100644 (file)
@@ -46,6 +46,6 @@ class Dismiss extends BaseApi
                $Notification->setDismissed();
                DI::notification()->save($Notification);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index 00ee47e5ac30c23972d2a7ed2611184675354b3d..c43bdf510fcf31002e214d92c8d87e77333d99e3 100644 (file)
@@ -42,6 +42,6 @@ class Polls extends BaseApi
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               System::jsonExit(DI::mstdnPoll()->createFromId($this->parameters['id'], $uid));
+               $this->jsonExit(DI::mstdnPoll()->createFromId($this->parameters['id'], $uid));
        }
 }
index 4b7d1300fe78e0cbe8d62a9f38ae39dadd95dcf5..d1f9d2d3076068e20acc4dfced62071da9006b38 100644 (file)
@@ -55,6 +55,6 @@ class Preferences extends BaseApi
 
                $preferences = new \Friendica\Object\Api\Mastodon\Preferences($visibility, $sensitive, $language, $media, $spoilers);
 
-               System::jsonExit($preferences);
+               $this->jsonExit($preferences);
        }
 }
index 401d3da1916ba13f1abb3e8355c3fbbb696f185d..cc9193620a2a7007a3c12fff62d324af08dc9422 100644 (file)
@@ -82,6 +82,6 @@ class Reports extends BaseApi
 
                $this->reportRepo->save($report);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index 8d2ce008619efbefe885a2971984e492e55444bc..6ac9430c679346df7686531bb8d7e45d582c058a 100644 (file)
@@ -56,7 +56,7 @@ class ScheduledStatuses extends BaseApi
 
                Post\Delayed::deleteById($this->parameters['id']);
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 
        /**
@@ -68,7 +68,7 @@ class ScheduledStatuses extends BaseApi
                $uid = self::getCurrentUserID();
 
                if (isset($this->parameters['id'])) {
-                       System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($this->parameters['id'], $uid)->toArray());
+                       $this->jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($this->parameters['id'], $uid)->toArray());
                }
 
                $request = $this->getRequest([
@@ -109,6 +109,6 @@ class ScheduledStatuses extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index 956e3d73b82a22562a2149cca1218c79689ed03f..e0f629527a28c28123099a5c7a7f17b76e62ce41 100644 (file)
@@ -91,7 +91,7 @@ class Search extends BaseApi
                        $result['hashtags'] = self::searchHashtags($request['q'], $request['exclude_unreviewed'], $limit, $request['offset'], $this->parameters['version']);
                }
 
-               System::jsonExit($result);
+               $this->jsonExit($result);
        }
 
        /**
index a8f1dc1c66353bee2205465055d14ebafb198b35..b916f4b4637569a359c34ce530243b6efecc0ee1 100644 (file)
@@ -159,7 +159,7 @@ class Statuses extends BaseApi
 
                Item::updateDisplayCache($post['uri-id']);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($post['uri-id'], $uid, self::appSupportsQuotes()));
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($post['uri-id'], $uid, self::appSupportsQuotes()));
        }
 
        protected function post(array $request = [])
@@ -299,14 +299,14 @@ class Statuses extends BaseApi
                        if (empty($id)) {
                                DI::mstdnError()->InternalError();
                        }
-                       System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($id, $uid)->toArray());
+                       $this->jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($id, $uid)->toArray());
                }
 
                $id = Item::insert($item, true);
                if (!empty($id)) {
                        $item = Post::selectFirst(['uri-id'], ['id' => $id]);
                        if (!empty($item['uri-id'])) {
-                               System::jsonExit(DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, self::appSupportsQuotes()));
+                               $this->jsonExit(DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, self::appSupportsQuotes()));
                        }
                }
 
@@ -331,7 +331,7 @@ class Statuses extends BaseApi
                        DI::mstdnError()->RecordNotFound();
                }
 
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 
        /**
@@ -345,7 +345,7 @@ class Statuses extends BaseApi
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), false));
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), false));
        }
 
        private function getApp(): string
@@ -422,7 +422,7 @@ class Statuses extends BaseApi
                if (preg_match("/\[url=[^\[\]]*\](.*)\[\/url\]\z/ism", $status, $matches)) {
                        $status = preg_replace("/\[url=[^\[\]]*\].*\[\/url\]\z/ism", PageInfo::getFooterFromUrl($matches[1]), $status);
                }
-               
+
                return $status;
        }
 }
index 7f32c9a43cefbd4a674165b63e1cf5bc408dee94..ff34a8529fda92f270445a78361b4c68386addc0 100644 (file)
@@ -70,6 +70,6 @@ class Bookmark extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index 3e973d9bbad795a211c848a3153dc1839a49b5fe..193bb7b0cd33ec02aa0405ed5ac5612461015646 100644 (file)
@@ -49,6 +49,6 @@ class Card extends BaseApi
 
                $card = DI::mstdnCard()->createFromUriId($post['uri-id']);
 
-               System::jsonExit($card->toArray());
+               $this->jsonExit($card->toArray());
        }
 }
index c510fc9a8c4db6a967ae9f701fbfccd9bd3160a7..3a73569f40fe3eb190a62e812d679658c9b56e5c 100644 (file)
@@ -140,7 +140,7 @@ class Context extends BaseApi
                        $statuses['descendants'][] = DI::mstdnStatus()->createFromUriId($descendant, $uid, $display_quotes);
                }
 
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 
        private static function getParents(int $id, array $parents, array $list = [])
index 3543a3ba8f656b9719183f9c34b0a9a46ef56158..da698c72f882849c55f35cefce7920b3defa014d 100644 (file)
@@ -54,6 +54,6 @@ class Favourite extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index fcfb97d92673ac2cf0324b42a2aadf9108638f2e..b6902a1c0252912e32bca827d9bc0c998cc0abbf 100644 (file)
@@ -56,6 +56,6 @@ class FavouritedBy extends BaseApi
                        $accounts[] = DI::mstdnAccount()->createFromContactId($activity['author-id'], $uid);
                }
 
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index a99cd686358c5d8dd2126fc4b6f33ad69017608c..56c352b34c8893930de533e5d0cf5435d9b91c24 100644 (file)
@@ -58,6 +58,6 @@ class Mute extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index 5d9a181135f0fdd012840db75a0e0ebb15a6943d..c95f02e9b086b505af5ddcfa073b3d0fd600dd1f 100644 (file)
@@ -53,6 +53,6 @@ class Pin extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(),$isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(),$isReblog)->toArray());
        }
 }
index 98cbd417d04691148cc455053f805ce2d3670f07..d0cf46b06d8ac2f8e3dba1d1b980e5fdcebfbb09 100644 (file)
@@ -63,6 +63,6 @@ class Reblog extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index a12975a8be244e3affc4d543875b6acf12d43903..ff0e1ba94e7a7f8b628957bca89fbced45a11c81 100644 (file)
@@ -56,6 +56,6 @@ class RebloggedBy extends BaseApi
                        $accounts[] = DI::mstdnAccount()->createFromContactId($activity['author-id'], $uid);
                }
 
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 92e2c3dbb2c5f574abd85fe8ff2e8852055aea5f..db997b0a3e40390a2582b6c0378c865d1faccab2 100644 (file)
@@ -52,6 +52,6 @@ class Source extends BaseApi
 
                $source = DI::mstdnStatusSource()->createFromUriId($id, $uid);
 
-               System::jsonExit($source->toArray());
+               $this->jsonExit($source->toArray());
        }
 }
index 556db2b4b329fd15e43556db3ff91619a1e5c437..3bda450e484130fca8993f619a9365611558d263 100644 (file)
@@ -70,6 +70,6 @@ class Unbookmark extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index 99358be55ae47e3032d212025f98e3dd3c765ba2..c41ed8d891923b63cfb4d772a42d0fddebe409dd 100644 (file)
@@ -54,6 +54,6 @@ class Unfavourite extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index b6d9c2b1959e5be456a8e210c54eb6cc6db8a57d..3668cb94599e29d7e35f7a2390612c17cf7dfde9 100644 (file)
@@ -58,6 +58,6 @@ class Unmute extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index 75b1d6fa5f94c5b03a2ce69a378efec6aa5beda9..fd23e3014b9216a3d8c7415b4c80353ba3150d66 100644 (file)
@@ -53,6 +53,6 @@ class Unpin extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index 6730e0fb56e9b834942c784867bc31d788543f8e..3d1f7ea9a6e26622608a1e0567e1f0101ef961fe 100644 (file)
@@ -69,6 +69,6 @@ class Unreblog extends BaseApi
                // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350
                $isReblog = $item['uri-id'] != $this->parameters['id'];
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
+               $this->jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray());
        }
 }
index 9645d39a2e47dc0c3e07bdef89cb43f5ab3d14dc..f18637b3d5e60417b6dd16b3b3cc4a5e059933d5 100644 (file)
@@ -54,6 +54,6 @@ class Suggestions extends BaseApi
                        ];
                }
 
-               System::jsonExit($accounts);
+               $this->jsonExit($accounts);
        }
 }
index 229fd8e005cd3fb96e656b48b19b1ecdb976cf6c..474bbe079658a7a36629d9b0f53387754e0108b3 100644 (file)
@@ -47,6 +47,6 @@ class Tags extends BaseApi
                $following = DBA::exists('search', ['uid' => $uid, 'term' => '#' . $tag]);
 
                $hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => $tag], [], $following);
-               System::jsonExit($hashtag->toArray());
+               $this->jsonExit($hashtag->toArray());
        }
 }
index 13137a75a88dd25ff69185b4a4753ba4c03665a2..ec27ea733cb9aa1919c72a1c10adff87d3d85814 100644 (file)
@@ -46,6 +46,6 @@ class Follow extends BaseApi
                }
 
                $hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => ltrim($this->parameters['hashtag'])], [], true);
-               System::jsonExit($hashtag->toArray());
+               $this->jsonExit($hashtag->toArray());
        }
 }
index 06b08b7c3d1130bb80a048a1977d312bfcae2263..02847f1fd2f1ed752d91fced2707447237e91871 100644 (file)
@@ -45,6 +45,6 @@ class Unfollow extends BaseApi
                DBA::delete('search', $term);
 
                $hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => ltrim($this->parameters['hashtag'])], [], false);
-               System::jsonExit($hashtag->toArray());
+               $this->jsonExit($hashtag->toArray());
        }
 }
index 82b96e698ff1961ba8fcc57ca7d0ea3c3193508f..e326bc7a12f3d27fe4a36d18bf9089bbdb6dc3d6 100644 (file)
@@ -86,6 +86,6 @@ class Direct extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index 6d0b7a33400f2f8a8353ed1d9afacaed252ba4fa..e9985508c4f8d36ef5e17986e1cdcc369f46ddc2 100644 (file)
@@ -101,6 +101,6 @@ class Home extends BaseApi
 
 
                self::setLinkHeader($request['friendica_order'] != TimelineOrderByTypes::ID);
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index 7f1d38c5c8fa3cbc3be3c4985334efab55299772..fa4605128bf9b5b02a6e71940c94d7e97fe47ba2 100644 (file)
@@ -105,6 +105,6 @@ class ListTimeline extends BaseApi
                }
 
                self::setLinkHeader($request['friendica_order'] != TimelineOrderByTypes::ID);
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index fa93d90c80786623422feeabc9db44dbda76ec38..057e2ec8d0530a0c497fe3a8d18866b0bf92388c 100644 (file)
@@ -102,6 +102,6 @@ class PublicTimeline extends BaseApi
                }
 
                self::setLinkHeader($request['friendica_order'] != TimelineOrderByTypes::ID);
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index 4943b51b07a9b9e50f48937b7c78f8b764343626..5b3e82508b1c1d28326b0f6f97efdce4f340e459 100644 (file)
@@ -131,6 +131,6 @@ class Tag extends BaseApi
                }
 
                self::setLinkHeader();
-               System::jsonExit($statuses);
+               $this->jsonExit($statuses);
        }
 }
index bfb35314789c31b0b2af03bc65ddd16675279216..9a14ebf1d6a5bf466c002820772b62a7451fcc1e 100644 (file)
@@ -60,6 +60,6 @@ class Links extends BaseApi
                        self::setLinkHeaderByOffsetLimit($request['offset'], $request['limit']);
                }
 
-               System::jsonExit($trending);
+               $this->jsonExit($trending);
        }
 }
index 336f67155968c3d97532b285f96f27740fa68fe5..0feb47cb7ff73a760c581af5cd6fa3992d260930 100644 (file)
@@ -67,6 +67,6 @@ class Statuses extends BaseApi
                        self::setLinkHeaderByOffsetLimit($request['offset'], $request['limit']);
                }
 
-               System::jsonExit($trending);
+               $this->jsonExit($trending);
        }
 }
index 2190a2e3c93a4b9bafbd7e6a619e4d89656b4424..b3a0667037a92671b447a4664c028bbd2c2ba705 100644 (file)
@@ -60,6 +60,6 @@ class Tags extends BaseApi
                        self::setLinkHeaderByOffsetLimit($request['offset'], $request['limit']);
                }
 
-               System::jsonExit($trending);
+               $this->jsonExit($trending);
        }
 }
index 53a9118b5219885dadff62c64d79c3e89b9e0180..e08dcf40fbea14e3a82786460f792c096bdb7dcd 100644 (file)
@@ -83,6 +83,6 @@ class Ids extends ContactEndpoint
 
                self::setLinkHeader();
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 9f55eb833a515f7ee772ee2c207d5176dce0cadb..21adc682b3b28fe002938292b98eedc4478dca8f 100644 (file)
@@ -114,6 +114,6 @@ class Ids extends ContactEndpoint
 
                self::setLinkHeader();
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 0f0523e120fc994f89783324b8fbfb88a654fd69..e12d67aae572dddff8dfc9d2c1944339aa0e7676 100644 (file)
@@ -114,6 +114,6 @@ class Ids extends ContactEndpoint
 
                self::setLinkHeader();
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 117530d2567fd1df738e82578e27268a4d8b0b3a..390294483692e2d650fde889ffae7c7c55511684 100644 (file)
@@ -121,7 +121,7 @@ abstract class BaseNotifications extends BaseModule
                        'page'          => $pager->getPage(),
                ];
 
-               System::jsonExit($notifications);
+               $this->jsonExit($notifications);
        }
 
        /**
index 165c7e79e87638f8f07db1dd7c1c8ca5a3ebc532..25129be780930c805d258d4029b5f4c4b9fc1145 100644 (file)
@@ -69,7 +69,7 @@ class Get extends \Friendica\BaseModule
                        $events = Event::getListByDate($owner['uid'], $request['start'] ?? '', $request['end'] ?? '');
                }
 
-               System::jsonExit($events ? self::map($events) : []);
+               $this->jsonExit($events ? self::map($events) : []);
        }
 
        private static function map(array $events): array
index a51583ae9f23d8e25df4129dc51f7d3c9d69443c..e2b6f8977891284303edae82f6a5719d3b4420ba 100644 (file)
@@ -132,7 +132,7 @@ class Circle extends BaseModule
                        }
 
                        DI::sysmsg()->addInfo($message);
-                       System::jsonExit(['status' => 'OK', 'message' => $message]);
+                       $this->jsonExit(['status' => 'OK', 'message' => $message]);
                } catch (\Exception $e) {
                        DI::sysmsg()->addNotice($e->getMessage());
                        System::jsonError($e->getCode(), ['status' => 'error', 'message' => $e->getMessage()]);
index fe4c846c92047ec438c2ba5d21c8acda7e515b76..10a07f6e6587dbc0206ca3897713c0a2d7d24e12 100644 (file)
@@ -142,7 +142,7 @@ class Friendica extends BaseModule
                                $data = ActivityPub\Transmitter::getProfile(0);
                                header('Access-Control-Allow-Origin: *');
                                header('Cache-Control: max-age=23200, stale-while-revalidate=23200');
-                               System::jsonExit($data, 'application/activity+json');
+                               $this->jsonExit($data, 'application/activity+json');
                        } catch (HTTPException\NotFoundException $e) {
                                System::jsonError(404, ['error' => 'Record not found']);
                        }
@@ -200,6 +200,6 @@ class Friendica extends BaseModule
                        'no_scrape_url'    => $this->baseUrl . '/noscrape',
                ];
 
-               System::jsonExit($data);
+               $this->jsonExit($data);
        }
 }
index 0c4c41c7e17c002334069025c9a17b8f82ed2333..3ba7b378e8fc3bd59ad674af72f632513d70aac6 100644 (file)
@@ -36,7 +36,7 @@ class Hashtag extends BaseModule
                $result = [];
 
                if (empty($request['t'])) {
-                       System::jsonExit($result);
+                       $this->jsonExit($result);
                }
 
                $taglist = DBA::select(
@@ -50,6 +50,6 @@ class Hashtag extends BaseModule
                }
                DBA::close($taglist);
 
-               System::jsonExit($result);
+               $this->jsonExit($result);
        }
 }
index c9d192d249f07458ca66cfe613c0c5126231d0f4..2175f730eea980836a7e18110bc79a1d967929a3 100644 (file)
@@ -89,6 +89,6 @@ class Activity extends BaseModule
                        'state' => 1,
                ];
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 1b64ebcd41443203b04d10313623f9c9bdba42bd..bfd69dbfe16a5767c9b6c767075be0d9ee258654 100644 (file)
@@ -71,6 +71,6 @@ class Follow extends BaseModule
                        'state' => 1
                ];
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 4950ba069d767728bf25ed429f1163f4bde435c8..b8883f9729ba87d0b847d3dfdbd81052d5fb20bd 100644 (file)
@@ -82,6 +82,6 @@ class Ignore extends BaseModule
                        'state'   => $ignored,
                ];
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index f3163a6b52e9983a0632926cfe40998fb902512c..ecca24a7f8fc39cf9f647796f6cddf2213783075 100644 (file)
@@ -84,6 +84,6 @@ class Pin extends BaseModule
                        'state'   => (int)$pinned,
                ];
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 931d0cca2177cd4e406b64b80640ca4ea6f3b9bf..c7dd244fd4635a51e557f57c3fa1f4534be9ff0e 100644 (file)
@@ -91,6 +91,6 @@ class Star extends BaseModule
                        'state'   => (int)$starred,
                ];
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index e98c83a6136b79147d2e772479ee7ae5382fdfd1..ed14bbbb707ce68d51dd0b10ada4db8b633beeee 100644 (file)
@@ -133,6 +133,6 @@ class Manifest extends BaseModule
                        $manifest['theme_color'] = $theme_color;
                }
 
-               Core\System::jsonExit($manifest, 'application/manifest+json');
+               $this->jsonExit($manifest, 'application/manifest+json');
        }
 }
index f5c5c725e0344928cca6bbd0f745f94025f0faed..8751b30bea32a2c1a183a74d1cf93446975261ec 100644 (file)
@@ -71,7 +71,7 @@ class NoScrape extends BaseModule
 
                if (!$owner['net-publish']) {
                        $json_info['hide'] = true;
-                       System::jsonExit($json_info);
+                       $this->jsonExit($json_info);
                }
 
                $keywords = $owner['pub_keywords'] ?? '';
@@ -107,6 +107,6 @@ class NoScrape extends BaseModule
                        }
                }
 
-               System::jsonExit($json_info);
+               $this->jsonExit($json_info);
        }
 }
index 70590c01fe1b16afe9a4d803aa25e938cc7ec5c9..a852a201c46e223c7e2a0a12a46c6b61fd35c31b 100644 (file)
@@ -116,7 +116,7 @@ class Notification extends BaseModule
                                $success = false;
                        }
 
-                       System::jsonExit(['result' => (($success) ? 'success' : 'fail')]);
+                       $this->jsonExit(['result' => (($success) ? 'success' : 'fail')]);
                }
        }
 
index 3b44bbe914354c3816a70f77ab77452965e43127..85b9b4d694c7f34c75fe9cfcf5615e2e1fa91f77 100644 (file)
@@ -305,7 +305,7 @@ class Ping extends BaseModule
                        // JSONP support
                        $this->httpExit($_GET['callback'] . '(' . json_encode(['result' => $data]) . ')', Response::TYPE_BLANK, 'application/javascript');
                } else {
-                       System::jsonExit(['result' => $data]);
+                       $this->jsonExit(['result' => $data]);
                }
        }
 }
index ccadfbeff8c0a1ac50d1eecf5576a0b76458bc89..cde4c36c633306c8bccf13a09510df46d0eab984 100644 (file)
@@ -55,6 +55,6 @@ class Revoke extends BaseApi
                }
 
                DBA::delete('application-token', ['application-id' => $token['id']]);
-               System::jsonExit([]);
+               $this->jsonExit([]);
        }
 }
index f5aec0802ed8f5df7760e9f08e4e1c4093d87f3f..61a7f22889e5bd5ed09f2afa4e252008a2da8ade 100644 (file)
@@ -110,6 +110,6 @@ class Token extends BaseApi
 
                $object = new \Friendica\Object\Api\Mastodon\Token($token['access_token'], 'Bearer', $application['scopes'], $token['created_at'], $me);
 
-               System::jsonExit($object->toArray());
+               $this->jsonExit($object->toArray());
        }
 }
index 69abd8e871fb5a2aa4640029b17199647f4d264c..2e5197112bbf7efaea1dff1d30476351791ee452 100644 (file)
@@ -101,6 +101,6 @@ class Owa extends BaseModule
                                }
                        }
                }
-               System::jsonExit($ret, 'application/x-zot+json');
+               $this->jsonExit($ret, 'application/x-zot+json');
        }
 }
index dfccafad42695cdeda008b9a7368aa607adc940c..7dbc2222051db2a10db0e9a9b175d62e3f7043ce 100644 (file)
@@ -100,7 +100,7 @@ class ParseUrl extends BaseModule
 
                if ($arr['text']) {
                        if ($format == 'json') {
-                               System::jsonExit($arr['text']);
+                               $this->jsonExit($arr['text']);
                        } else {
                                $this->httpExit($arr['text']);
                        }
@@ -133,7 +133,7 @@ class ParseUrl extends BaseModule
                                $ret['success'] = true;
                        }
 
-                       System::jsonExit($ret);
+                       $this->jsonExit($ret);
                } else {
                        $this->httpExit(BBCode::embedURL($url, empty($_GET['noAttachment']), $title, $description, $_GET['tags'] ?? ''));
                }
index 99262fcc50db6312083fccdebffcc32af9db43f6..023cc38a5a93c645b9d4e7d5769a65a9e5ed836c 100644 (file)
@@ -87,7 +87,7 @@ class Profile extends BaseProfile
                                        $data = ActivityPub\Transmitter::getProfile($user['uid'], ActivityPub::isAcceptedRequester($user['uid']));
                                        header('Access-Control-Allow-Origin: *');
                                        header('Cache-Control: max-age=23200, stale-while-revalidate=23200');
-                                       System::jsonExit($data, 'application/activity+json');
+                                       $this->jsonExit($data, 'application/activity+json');
                                } catch (HTTPException\NotFoundException $e) {
                                        System::jsonError(404, ['error' => 'Record not found']);
                                }
index 66e371dd17a5aadda34bced550826428faa8777a..857e2fdf9fe74b02a666a3f8235e7cee3c6f482c 100644 (file)
@@ -80,7 +80,7 @@ class Acl extends BaseModule
                        $o = $this->regularContactSearch($request, $type);
                }
 
-               System::jsonExit($o);
+               $this->jsonExit($o);
        }
 
        private function globalContactSearch(array $request): array
index a2f68b734d42b3bfd8f93b7443080f34dc352f5d..12196f8058ee2eabdfa14de3c2a249ae748e5a29 100644 (file)
@@ -59,7 +59,7 @@ class Tags extends BaseModule
                $results = [];
 
                if (empty($tags)) {
-                       System::jsonExit([
+                       $this->jsonExit([
                                'total'      => 0,
                                'items_page' => $perPage,
                                'page'       => $page,
@@ -74,7 +74,7 @@ class Tags extends BaseModule
 
                $totalCount = $this->database->count('owner-view', $condition);
                if ($totalCount === 0) {
-                       System::jsonExit([
+                       $this->jsonExit([
                                'total'      => 0,
                                'items_page' => $perPage,
                                'page'       => $page,
@@ -97,7 +97,7 @@ class Tags extends BaseModule
 
                $this->database->close($searchStmt);
 
-               System::jsonExit([
+               $this->jsonExit([
                        'total'      => $totalCount,
                        'items_page' => $perPage,
                        'page'       => $page,
index c496283a8e4372162f79641951bd21dfb9befc42..52acb19242822e843edff96e0317058ecbdee6a0 100644 (file)
@@ -41,7 +41,7 @@ class Smilies extends BaseModule
                        for ($i = 0; $i < count($smilies['texts']); $i++) {
                                $results[] = ['text' => $smilies['texts'][$i], 'icon' => $smilies['icons'][$i]];
                        }
-                       System::jsonExit($results);
+                       $this->jsonExit($results);
                }
        }
 
index dc205578222eeb3abe11c8cfaff1bfb287adced1..d0d46a1ab2464fd9774ce46465c94b817f5d6d7a 100644 (file)
@@ -83,6 +83,6 @@ class Statistics extends BaseModule
                ], $services);
 
                $this->logger->debug("statistics.", ['statistics' => $statistics]);
-               System::jsonExit($statistics);
+               $this->jsonExit($statistics);
        }
 }
index 1291d3309552b672acd167bd088b619f69e9d85c..fed86d1e8b615d25ba8066b8094187e86072c0fe 100644 (file)
@@ -41,7 +41,7 @@ class ThemeDetails extends BaseModule
                        $version     = $info['version']     ?? '';
                        $credits     = $info['credits']     ?? '';
 
-                       System::jsonExit([
+                       $this->jsonExit([
                                'img'     => Theme::getScreenshot($theme),
                                'desc'    => $description,
                                'version' => $version,
index f3d02383e16a47b82cf96c6a21ed1181bf362c69..b409bd1dc3498264db24622ede0e8cdf3232b1a4 100644 (file)
@@ -268,6 +268,6 @@ class PortableContacts extends BaseModule
 
                $this->logger->info('End of poco');
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }
index 9ae641d41d8b909491b16267919b853cde3a91b2..07a2a7619999459e682527976b08ff49d7d280a1 100644 (file)
@@ -32,26 +32,16 @@ use Friendica\DI;
 class NodeInfo extends BaseModule
 {
        protected function rawContent(array $request = [])
-       {
-               self::printWellKnown();
-       }
-
-       /**
-        * Prints the well-known nodeinfo redirect
-        *
-        * @throws \Friendica\Network\HTTPException\NotFoundException
-        */
-       private static function printWellKnown()
        {
                $nodeinfo = [
                        'links' => [
                                ['rel'  => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
-                               'href' => DI::baseUrl() . '/nodeinfo/1.0'],
+                                'href' => DI::baseUrl() . '/nodeinfo/1.0'],
                                ['rel'  => 'http://nodeinfo.diaspora.software/ns/schema/2.0',
-                               'href' => DI::baseUrl() . '/nodeinfo/2.0'],
+                                'href' => DI::baseUrl() . '/nodeinfo/2.0'],
                        ]
                ];
 
-               System::jsonExit($nodeinfo);
+               $this->jsonExit($nodeinfo);
        }
 }
index 22d1b08a4eab0051baeebd85b45c8bff0cec24ea..4ed110391349ec866a46392ea70d12e9bdbec481 100644 (file)
@@ -77,6 +77,6 @@ class XSocialRelay extends BaseModule
                        $relay['protocols']['diaspora'] = ['receive' => DI::baseUrl() . '/receive/public'];
                }
 
-               System::jsonExit($relay);
+               $this->jsonExit($relay);
        }
 }
index 40358250e61962bd8a67f6fcd1ea4368f144fd38..097ec3c3224ddcf743a316452425afb827e38143 100644 (file)
@@ -156,7 +156,7 @@ class Xrd extends BaseModule
                        ]
                ];
                header('Access-Control-Allow-Origin: *');
-               System::jsonExit($json, 'application/jrd+json; charset=utf-8');
+               $this->jsonExit($json, 'application/jrd+json; charset=utf-8');
        }
 
        private function printJSON(string $alias, array $owner, array $avatar)
@@ -233,7 +233,7 @@ class Xrd extends BaseModule
                ];
 
                header('Access-Control-Allow-Origin: *');
-               System::jsonExit($json, 'application/jrd+json; charset=utf-8');
+               $this->jsonExit($json, 'application/jrd+json; charset=utf-8');
        }
 
        private function printXML(string $alias, array $owner, array $avatar)