From 44e70bdca367344c441b1e26e790ac0465953734 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 18 Dec 2012 19:10:56 -0800 Subject: send stuff to zothub as a fallback directory master for now --- include/directory.php | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/directory.php b/include/directory.php index f35cb4cb4..5b5698768 100644 --- a/include/directory.php +++ b/include/directory.php @@ -1,27 +1,56 @@ argv(1)); + $x = q("select * from channel where channel_id = %d limit 1", + intval($argv[1]) + ); + if(! $x) + return; - call_hooks('globaldir_update', $arr); + $channel = $x[0]; - if(strlen($arr['url'])) - fetch_url($dir . '?url=' . bin2hex($arr['url'])); + // is channel profile visible to the public? + // FIXME - remove dir entry if permission is revoked + + if(! perm_is_allowed($channel['channel_id'],null,'view_profile')) + return; + + $directory = find_upstream_directory($dirmode); + + if($directory) { + $url = $directory['url']; + } + else { + $url = DIRECTORY_FALLBACK_MASTER . '/post'; + } + + $packet = zot_build_packet($channel,'refresh'); + $z = zot_zot($url,$packet); + + // re-queue if unsuccessful - return; } if (array_search(__file__,get_included_files())===0){ -- cgit v1.2.3