]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/WellKnown/XSocialRelay.php
Use centralized function to fetch query results
[friendica.git] / src / Module / WellKnown / XSocialRelay.php
index 6dcd65c50584ad19bfb5de75f2963ecb076a4fb7..bf767a3e7ba0f0d34b5570ab42596a9629dc73e6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,6 +24,7 @@ namespace Friendica\Module\WellKnown;
 use Friendica\BaseModule;
 use Friendica\DI;
 use Friendica\Model\Search;
+use Friendica\Protocol\Relay;
 
 /**
  * Node subscription preferences for social realy systems
@@ -31,7 +32,7 @@ use Friendica\Model\Search;
  */
 class XSocialRelay extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
@@ -40,12 +41,12 @@ class XSocialRelay extends BaseModule
                $systemTags = [];
                $userTags = [];
 
-               if ($scope == SR_SCOPE_TAGS) {
+               if ($scope == Relay::SCOPE_TAGS) {
                        $server_tags = $config->get('system', 'relay_server_tags');
                        $tagitems = explode(',', $server_tags);
 
                        /// @todo Check if it was better to use "strtolower" on the tags
-                       foreach ($tagitems AS $tag) {
+                       foreach ($tagitems as $tag) {
                                $systemTags[] = trim($tag, '# ');
                        }
 
@@ -57,7 +58,7 @@ class XSocialRelay extends BaseModule
                $tagList = array_unique(array_merge($systemTags, $userTags));
 
                $relay = [
-                       'subscribe' => ($scope != SR_SCOPE_NONE),
+                       'subscribe' => ($scope != Relay::SCOPE_NONE),
                        'scope'     => $scope,
                        'tags'      => $tagList,
                        'protocols' => [