From 93f4f07c122613c0afd2257bd9e898629124178a Mon Sep 17 00:00:00 2001 From: James Walker Date: Thu, 25 Feb 2010 17:52:18 -0500 Subject: [PATCH] moving webfinger action to xrdaction --- plugins/OStatus/OStatusPlugin.php | 4 ++-- plugins/OStatus/actions/hostmeta.php | 2 +- plugins/OStatus/actions/{webfinger.php => xrd.php} | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename plugins/OStatus/actions/{webfinger.php => xrd.php} (96%) diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 9a543df3b3..91d0554982 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -43,8 +43,8 @@ class OStatusPlugin extends Plugin // Discovery actions $m->connect('.well-known/host-meta', array('action' => 'hostmeta')); - $m->connect('main/webfinger', - array('action' => 'webfinger')); + $m->connect('main/xrd', + array('action' => 'xrd')); $m->connect('main/ostatus', array('action' => 'ostatusinit')); $m->connect('main/ostatus?nickname=:nickname', diff --git a/plugins/OStatus/actions/hostmeta.php b/plugins/OStatus/actions/hostmeta.php index 85715ecf4c..3d00b98ae0 100644 --- a/plugins/OStatus/actions/hostmeta.php +++ b/plugins/OStatus/actions/hostmeta.php @@ -32,7 +32,7 @@ class HostMetaAction extends Action parent::handle(); $domain = common_config('site', 'server'); - $url = common_local_url('webfinger'); + $url = common_local_url('xrd'); $url.= '?uri={uri}'; $xrd = new XRD(); diff --git a/plugins/OStatus/actions/webfinger.php b/plugins/OStatus/actions/xrd.php similarity index 96% rename from plugins/OStatus/actions/webfinger.php rename to plugins/OStatus/actions/xrd.php index fa41b24446..cc5c70b08e 100644 --- a/plugins/OStatus/actions/webfinger.php +++ b/plugins/OStatus/actions/xrd.php @@ -24,7 +24,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -class WebfingerAction extends Action +class XrdAction extends Action { public $uri; @@ -44,7 +44,7 @@ class WebfingerAction extends Action $xrd = new XRD(); - list($nick, $domain) = explode('@', urldecode($acct)); + list($nick, $domain) = explode('@', substr(urldecode($acct), 5)); $nick = common_canonical_nickname($nick); $this->user = User::staticGet('nickname', $nick); @@ -91,7 +91,7 @@ class WebfingerAction extends Action if (!$magickey) { // No keypair yet, let's generate one. $magickey = new Magicsig(); - $magickey->generate(); + $magickey->generate($this->user->id); } $xrd->links[] = array('rel' => Magicsig::PUBLICKEYREL, -- 2.39.5