From c34d8286a397b8a80d28a9b1d13a297196e4c124 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 16 Sep 2015 21:27:58 -0700 Subject: change matrix to grid, begin webfinger optimisation --- mod/wfinger.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mod/wfinger.php') diff --git a/mod/wfinger.php b/mod/wfinger.php index c61a97b30..7b9eaa461 100644 --- a/mod/wfinger.php +++ b/mod/wfinger.php @@ -18,6 +18,8 @@ function wfinger_init(&$a) { killme(); } + $zot = intval($_REQUEST['zot']); + $resource = $_REQUEST['resource']; logger('webfinger: ' . $resource,LOGGER_DEBUG); @@ -30,7 +32,7 @@ function wfinger_init(&$a) { if(strpos($channel,'@') !== false) { $host = substr($channel,strpos($channel,'@')+1); if(strcasecmp($host,get_app()->get_hostname())) { - goaway('https://' . $host . '/.well-known/webfinger?resource=' . $resource); + goaway('https://' . $host . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=' . $zot : '')); } $channel = substr($channel,0,strpos($channel,'@')); } @@ -52,10 +54,9 @@ function wfinger_init(&$a) { header('Content-type: application/jrd+json'); - if($resource && $r) { - $h = q("select hubloc_addr from hubloc where hubloc_hash = '%s'", + $h = q("select hubloc_addr from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0", dbesc($r[0]['channel_hash']) ); @@ -105,6 +106,13 @@ function wfinger_init(&$a) { ) ); + if($zot) { + // @FIXME do a lookup straightaway and return the zot-info packet + + $_REQUEST['address'] = $r[0]['xchan_address']; + + + } } else { header($_SERVER["SERVER_PROTOCOL"] . ' ' . 400 . ' ' . 'Bad Request'); -- cgit v1.2.3