aboutsummaryrefslogtreecommitdiffstats
path: root/mod/zfinger.php
diff options
context:
space:
mode:
authorTony Baldwin <tonybaldwin@gmx.com>2014-03-09 19:22:54 -0400
committerTony Baldwin <tonybaldwin@gmx.com>2014-03-09 19:22:54 -0400
commit5cca00ddc79dad667464674e08a2a860e262eabd (patch)
tree53df980e32a6706e977a5a2276e0f9aa9ec09300 /mod/zfinger.php
parent67166180bb560276273a20bcd9ca2a7aae036aba (diff)
parenta79072ce478a999b06df38ae324fbcef6d3a76e7 (diff)
downloadvolse-hubzilla-5cca00ddc79dad667464674e08a2a860e262eabd.tar.gz
volse-hubzilla-5cca00ddc79dad667464674e08a2a860e262eabd.tar.bz2
volse-hubzilla-5cca00ddc79dad667464674e08a2a860e262eabd.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: view/theme/redbasic/tpl/theme_settings.tpl reset to upstream
Diffstat (limited to 'mod/zfinger.php')
-rw-r--r--mod/zfinger.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 94671271b..4f59c1973 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -176,10 +176,21 @@ 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);
+
+ if($ztarget_hash) {
+ $permissions['connected'] = false;
+ $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);