From: Evan Prodromou Date: Sat, 27 Nov 2010 02:46:51 +0000 (-0500) Subject: Make userxrd part of the default hostmeta X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fcc0825b14c1499ec97088fa4ec39a7bbb4d0ec1;p=quix0rs-gnu-social.git Make userxrd part of the default hostmeta --- diff --git a/actions/hostmeta.php b/actions/hostmeta.php index b7beee5a86..2587bb6b91 100644 --- a/actions/hostmeta.php +++ b/actions/hostmeta.php @@ -51,6 +51,11 @@ class HostMetaAction extends Action $xrd->host = $domain; if(Event::handle('StartHostMetaLinks', array(&$xrd->links))) { + $url = common_local_url('userxrd'); + $url.= '?uri={uri}'; + $xrd->links[] = array('rel' => Discovery::LRDD_REL, + 'template' => $url, + 'title' => array('Resource Descriptor')); Event::handle('EndHostMetaLinks', array(&$xrd->links)); } diff --git a/lib/router.php b/lib/router.php index 6912bd7cf8..47357ca085 100644 --- a/lib/router.php +++ b/lib/router.php @@ -151,6 +151,8 @@ class Router array('action' => 'publicxrds')); $m->connect('.well-known/host-meta', array('action' => 'hostmeta')); + $m->connect('main/xrd', + array('action' => 'userxrd')); // these take a code diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 8aedebe412..7d62eaba6d 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -52,8 +52,6 @@ class OStatusPlugin extends Plugin function onRouterInitialized($m) { // Discovery actions - $m->connect('main/xrd', - array('action' => 'userxrd')); $m->connect('main/ownerxrd', array('action' => 'ownerxrd')); $m->connect('main/ostatus', @@ -1010,14 +1008,6 @@ class OStatusPlugin extends Plugin return true; } - function onStartHostMetaLinks(&$links) { - $url = common_local_url('userxrd'); - $url.= '?uri={uri}'; - $links[] = array('rel' => Discovery::LRDD_REL, - 'template' => $url, - 'title' => array('Resource Descriptor')); - } - function onEndXrdActionLinks(&$xrd, $user) { // Salmon