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)
wk_social_relay();
break;
case "nodeinfo":
- nodeinfo_wellknown($a);
+ Nodeinfo::printWellKnown($a);
break;
case "webfinger":
xrd_init($a);
}
}
System::httpExit(404);
- killme();
}
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')) {
$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');