diff options
author | friendica <info@friendica.com> | 2014-03-02 19:40:59 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-03-02 19:40:59 -0800 |
commit | 7baeb451836752a612ca976db04aeffcafeb621d (patch) | |
tree | 09a75e437616318eecc689c5331344c112fe4afd /mod | |
parent | b98ddc69de966fbb8a47ba5ca4947c6cb3f81618 (diff) | |
download | volse-hubzilla-7baeb451836752a612ca976db04aeffcafeb621d.tar.gz volse-hubzilla-7baeb451836752a612ca976db04aeffcafeb621d.tar.bz2 volse-hubzilla-7baeb451836752a612ca976db04aeffcafeb621d.zip |
some anomolies found when viewing connections in various cases.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/zfinger.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/mod/zfinger.php b/mod/zfinger.php index 94671271b..75abfefe4 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -176,10 +176,22 @@ function zfinger_init(&$a) { $ret['follow_url'] = z_root() . '/follow?f=&url=%s'; - $permissions = get_all_perms($e['channel_id'],(($ztarget && $zsig) + $ztarget_hash = (($ztarget && $zsig) ? base64url_encode(hash('whirlpool',$ztarget . $zsig,true)) - : '' ),false); + : '' ); + $permissions = get_all_perms($e['channel_id'],$ztarget_hash,false); + + $permissions['connected'] = false; + + if($ztarget_hash) { + $b = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1", + dbesc($ztarget_hash), + intval($e['channel_id']) + ); + if($b) + $permissions['connected'] = true; + } $ret['permissions'] = (($ztarget && $zkey) ? aes_encapsulate(json_encode($permissions),$zkey) : $permissions); |