From 2d3a489f5171a8fe8b6b7aeb022c945a689d9f1a Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 21 Aug 2013 17:15:56 -0700 Subject: basic structure for premium channel implementation --- mod/zfinger.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mod/zfinger.php') diff --git a/mod/zfinger.php b/mod/zfinger.php index cf61233ad..d5b750537 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -71,6 +71,8 @@ function zfinger_init(&$a) { $id = $e['channel_id']; + $special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false); + $searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true); if($e['xchan_flags'] & XCHAN_FLAGS_HIDDEN) $searchable = false; @@ -134,6 +136,16 @@ function zfinger_init(&$a) { $ret['searchable'] = $searchable; + // premium or other channel desiring some contact with potential followers before connecting. + // This is a template - %s will be replaced with the follow_url we discover for the return channel. + + if($special_channel) + $ret['connect_url'] = z_root() . '/connect/' . $e['channel_address'] . '?f=&follow=%s'; + + // This is a template for our follow url, %s will be replaced with a webbie + + $ret['follow_url'] = z_root() . '/follow?f=&url=%s'; + $permissions = get_all_perms($e['channel_id'],(($ztarget && $zsig) ? base64url_encode(hash('whirlpool',$ztarget . $zsig,true)) : '' ),false); -- cgit v1.2.3