diff options
author | friendica <info@friendica.com> | 2012-08-21 23:11:27 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-08-21 23:11:27 -0700 |
commit | 2140c2ea37737e591b562cccc71c63e95abd8667 (patch) | |
tree | d6cef87f445b95d2f5b40e4a7239bbff98545f43 /mod/zfinger.php | |
parent | 72d38d75bf50b1d4696ab6c770d81f5751fbf061 (diff) | |
download | volse-hubzilla-2140c2ea37737e591b562cccc71c63e95abd8667.tar.gz volse-hubzilla-2140c2ea37737e591b562cccc71c63e95abd8667.tar.bz2 volse-hubzilla-2140c2ea37737e591b562cccc71c63e95abd8667.zip |
basic hub registration
Diffstat (limited to 'mod/zfinger.php')
-rw-r--r-- | mod/zfinger.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/mod/zfinger.php b/mod/zfinger.php index 1da5c613b..77d9555d3 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -25,27 +25,30 @@ function zfinger_init(&$a) { $ret['success'] = true; + // Communication details + $ret['guid'] = $e['entity_global_id']; - $ret['url'] = z_root(); - $ret['primary'] = (bool) $e['entity_primary']; - $ret['callback'] = z_root() . '/' . 'post'; - $ret['sitekey'] = get_config('system','pubkey'); - $ret['key'] = $e['pubkey']; + $ret['key'] = $e['pubkey']; + + // array of (verified) hubs this entity uses $ret['hubs'] = array(); $x = zot_get_hubloc(array($e['entity_global_id'])); if($x && count($x)) { foreach($x as $hub) { - $ret['hubs'][] = array( - 'primary' => (bool) $hub['hubloc_primary'], - 'url' => $hub['hubloc_url'], + if(! ($hub['hubloc_flags'] & HUBLOC_FLAGS_UNVERIFIED)) { + $ret['hubs'][] = array( + 'primary' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false), + 'url' => $hub['hubloc_url'], 'callback' => $hub['hubloc_callback'], - 'sitekey' => $hub['hubloc_sitekey'] - ); + 'sitekey' => $hub['hubloc_sitekey'] + ); + } } } - // more stuff + + // more stuff, e.g. the basic public profile json_return_and_die($ret); |