From fcc0825b14c1499ec97088fa4ec39a7bbb4d0ec1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 26 Nov 2010 21:46:51 -0500 Subject: [PATCH] Make userxrd part of the default hostmeta --- actions/hostmeta.php | 5 +++++ lib/router.php | 2 ++ plugins/OStatus/OStatusPlugin.php | 10 ---------- 3 files changed, 7 insertions(+), 10 deletions(-) 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