From 805e2a28ee81febee2742587a1640b5fae1387a2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 9 Jun 2015 16:29:51 -0700 Subject: add nomadic identities as webfinger aliases --- mod/wfinger.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/wfinger.php b/mod/wfinger.php index eba17de51..1493dd6ba 100644 --- a/mod/wfinger.php +++ b/mod/wfinger.php @@ -55,14 +55,23 @@ function wfinger_init(&$a) { if($resource && $r) { + $h = q("select hubloc_addr from hubloc where hubloc_hash = '%s'", + dbesc($r[0]['channel_hash']) + ); + $result['subject'] = $resource; $aliases = array( - 'acct:' . $r[0]['channel_address'] . '@' . $a->get_hostname(), z_root() . '/channel/' . $r[0]['channel_address'], z_root() . '/~' . $r[0]['channel_address'] ); + if($h) { + foreach($h as $hh) { + $aliases[] = 'acct:' . $hh['hubloc_addr']; + } + } + $result['aliases'] = array(); $result['properties'] = array('http://webfinger.net/ns/name' => $r[0]['channel_name']); -- cgit v1.2.3