X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FNodeInfo110.php;h=9935e9089a24219ea891bf6abc119cb1a3fd922f;hb=036b565a7846916f763ce1dcbcaade0844ff1589;hp=d8f8a5049a3c1ee42051f4af3cd4c56ecb8824a2;hpb=190efcefad29a5971a0cd487d2d67dab638c5a4e;p=friendica.git diff --git a/src/Module/NodeInfo110.php b/src/Module/NodeInfo110.php index d8f8a5049a..9935e9089a 100644 --- a/src/Module/NodeInfo110.php +++ b/src/Module/NodeInfo110.php @@ -1,6 +1,6 @@ config = $config; + } + protected function rawContent(array $request = []) + { $nodeinfo = [ 'version' => '1.0', 'software' => [ @@ -53,19 +65,19 @@ class NodeInfo110 extends BaseModule ], 'services' => [], 'usage' => [], - 'openRegistrations' => intval($config->get('config', 'register_policy')) !== Register::CLOSED, + 'openRegistrations' => intval($this->config->get('config', 'register_policy')) !== Register::CLOSED, 'metadata' => [ - 'nodeName' => $config->get('config', 'sitename'), + 'nodeName' => $this->config->get('config', 'sitename'), ], ]; - if (!empty($config->get('system', 'diaspora_enabled'))) { - $nodeinfo['protocols']['inbound'][] = 'diaspora'; + if (!empty($this->config->get('system', 'diaspora_enabled'))) { + $nodeinfo['protocols']['inbound'][] = 'diaspora'; $nodeinfo['protocols']['outbound'][] = 'diaspora'; } - if (empty($config->get('system', 'ostatus_disabled'))) { - $nodeinfo['protocols']['inbound'][] = 'gnusocial'; + if (empty($this->config->get('system', 'ostatus_disabled'))) { + $nodeinfo['protocols']['inbound'][] = 'gnusocial'; $nodeinfo['protocols']['outbound'][] = 'gnusocial'; } @@ -73,10 +85,10 @@ class NodeInfo110 extends BaseModule $nodeinfo['services'] = Nodeinfo::getServices(); - $nodeinfo['metadata']['protocols'] = $nodeinfo['protocols']; + $nodeinfo['metadata']['protocols'] = $nodeinfo['protocols']; $nodeinfo['metadata']['protocols']['outbound'][] = 'atom1.0'; - $nodeinfo['metadata']['protocols']['inbound'][] = 'atom1.0'; - $nodeinfo['metadata']['protocols']['inbound'][] = 'rss2.0'; + $nodeinfo['metadata']['protocols']['inbound'][] = 'atom1.0'; + $nodeinfo['metadata']['protocols']['inbound'][] = 'rss2.0'; $nodeinfo['metadata']['services'] = $nodeinfo['services']; @@ -84,8 +96,9 @@ class NodeInfo110 extends BaseModule $nodeinfo['metadata']['services']['inbound'][] = 'twitter'; } - $nodeinfo['metadata']['explicitContent'] = $config->get('system', 'explicit_content', false) == true; + $nodeinfo['metadata']['explicitContent'] = $this->config->get('system', 'explicit_content', false) == true; - System::jsonExit($nodeinfo, 'application/json; charset=utf-8', JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); + $this->response->setType(ICanCreateResponses::TYPE_JSON); + $this->response->addContent(json_encode($nodeinfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); } }