]> git.mxchange.org Git - friendica.git/blobdiff - mod/_well_known.php
Storing the protocol while following a contact
[friendica.git] / mod / _well_known.php
index 25289171f67f3f9f4965c7b80acda5b3dd38d66a..8e82dabeff2adaf64c37fc20e08fe14cfeb38c74 100644 (file)
@@ -3,9 +3,9 @@
 use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\System;
+use Friendica\Module\Nodeinfo;
 
 require_once 'mod/hostxrd.php';
-require_once 'mod/nodeinfo.php';
 require_once 'mod/xrd.php';
 
 function _well_known_init(App $a)
@@ -19,7 +19,7 @@ function _well_known_init(App $a)
                                wk_social_relay();
                                break;
                        case "nodeinfo":
-                               nodeinfo_wellknown($a);
+                               Nodeinfo::printWellKnown($a);
                                break;
                        case "webfinger":
                                xrd_init($a);
@@ -27,7 +27,6 @@ function _well_known_init(App $a)
                }
        }
        System::httpExit(404);
-       killme();
 }
 
 function wk_social_relay()
@@ -46,8 +45,10 @@ function wk_social_relay()
                $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) {
-                       $tags[trim($tag, "# ")] = trim($tag, "# ");
+                       $tag = trim($tag, "# ");
+                       $tags[$tag] = $tag;
                }
 
                if (Config::get('system', 'relay_user_tags')) {
@@ -62,13 +63,17 @@ function wk_social_relay()
 
        $taglist = [];
        foreach ($tags AS $tag) {
-               $taglist[] = $tag;
+               if (!empty($tag)) {
+                       $taglist[] = $tag;
+               }
        }
 
        $relay = [
-               "subscribe" => $subscribe,
-               "scope" => $scope,
-               "tags" => $taglist
+               'subscribe' => $subscribe,
+               'scope' => $scope,
+               'tags' => $taglist,
+               'protocols' => ['diaspora' => ['receive' => System::baseUrl() . '/receive/public'],
+                       'dfrn' => ['receive' => System::baseUrl() . '/dfrn_notify']]
        ];
 
        header('Content-type: application/json; charset=utf-8');