aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/wfinger.php14
-rw-r--r--mod/zfinger.php11
2 files changed, 11 insertions, 14 deletions
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');
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 54ea52bc9..4f2b1fca7 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -25,17 +25,6 @@ function zfinger_init(&$a) {
}
}
- // allow re-written domains so bob@foo.example.com can provide an address of bob@example.com
- // The top-level domain also needs to redirect .well-known/zot-info to the sub-domain with a 301 or 308
-
- // TODO: Make 308 work in include/network.php for zot_fetch_url and zot_post_url
-
- if(($zaddr) && ($s = get_config('system','zotinfo_domainrewrite'))) {
- $arr = explode('^',$s);
- if(count($arr) == 2)
- $zaddr = str_replace($arr[0],$arr[1],$zaddr);
- }
-
$r = null;
if(strlen($zhash)) {