]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/WellKnown/XSocialRelay.php
Merge branch '2023.03-rc' into stable
[friendica.git] / src / Module / WellKnown / XSocialRelay.php
index 96968680dc7f3126f3a81da9a786187869337978..22d1b08a4eab0051baeebd85b45c8bff0cec24ea 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
 namespace Friendica\Module\WellKnown;
 
 use Friendica\BaseModule;
+use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Model\Search;
 use Friendica\Protocol\Relay;
 
 /**
- * Node subscription preferences for social realy systems
+ * Node subscription preferences for social relay systems
  * @see https://git.feneas.org/jaywink/social-relay/blob/master/docs/relays.md
  */
 class XSocialRelay extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
@@ -63,21 +64,19 @@ class XSocialRelay extends BaseModule
                        'tags'      => $tagList,
                        'protocols' => [
                                'activitypub' => [
-                                       'actor' => DI::baseUrl()->get() . '/friendica',
-                                       'receive' => DI::baseUrl()->get() . '/inbox'
+                                       'actor' => DI::baseUrl() . '/friendica',
+                                       'receive' => DI::baseUrl() . '/inbox'
                                ],
                                'dfrn'     => [
-                                       'receive' => DI::baseUrl()->get() . '/dfrn_notify'
+                                       'receive' => DI::baseUrl() . '/dfrn_notify'
                                ]
                        ]
                ];
 
                if (DI::config()->get("system", "diaspora_enabled")) {
-                       $relay['protocols']['diaspora'] = ['receive' => DI::baseUrl()->get() . '/receive/public'];
+                       $relay['protocols']['diaspora'] = ['receive' => DI::baseUrl() . '/receive/public'];
                }
 
-               header('Content-type: application/json; charset=utf-8');
-               echo json_encode($relay, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
-               exit;
+               System::jsonExit($relay);
        }
 }