X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FWellKnown%2FXSocialRelay.php;h=bf767a3e7ba0f0d34b5570ab42596a9629dc73e6;hb=69b7923df2beed71419bc38e61ca9755fad24b12;hp=1876de8b8bf99ba356b9efbe7fc82c8088700076;hpb=01640a7045e146759bc936dd499ac27738b78940;p=friendica.git diff --git a/src/Module/WellKnown/XSocialRelay.php b/src/Module/WellKnown/XSocialRelay.php index 1876de8b8b..bf767a3e7b 100644 --- a/src/Module/WellKnown/XSocialRelay.php +++ b/src/Module/WellKnown/XSocialRelay.php @@ -1,6 +1,6 @@ get('system', 'relay_subscribe', false); - - if ($subscribe) { - $scope = $config->get('system', 'relay_scope', SR_SCOPE_ALL); - } else { - $scope = SR_SCOPE_NONE; - } + $scope = $config->get('system', 'relay_scope'); $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, '# '); } @@ -63,12 +58,13 @@ class XSocialRelay extends BaseModule $tagList = array_unique(array_merge($systemTags, $userTags)); $relay = [ - 'subscribe' => $subscribe, + 'subscribe' => ($scope != Relay::SCOPE_NONE), 'scope' => $scope, 'tags' => $tagList, 'protocols' => [ - 'diaspora' => [ - 'receive' => DI::baseUrl()->get() . '/receive/public' + 'activitypub' => [ + 'actor' => DI::baseUrl()->get() . '/friendica', + 'receive' => DI::baseUrl()->get() . '/inbox' ], 'dfrn' => [ 'receive' => DI::baseUrl()->get() . '/dfrn_notify' @@ -76,6 +72,10 @@ class XSocialRelay extends BaseModule ] ]; + if (DI::config()->get("system", "diaspora_enabled")) { + $relay['protocols']['diaspora'] = ['receive' => DI::baseUrl()->get() . '/receive/public']; + } + header('Content-type: application/json; charset=utf-8'); echo json_encode($relay, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); exit;