diff options
Diffstat (limited to 'mod/zfinger.php')
-rw-r--r-- | mod/zfinger.php | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/mod/zfinger.php b/mod/zfinger.php index 6b93b3410..4f2b1fca7 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -25,17 +25,6 @@ function zfinger_init(&$a) { } } - // allow re-written domains so bob@foo.example.com can provide an address of bob@example.com - // The top-level domain also needs to redirect .well-known/zot-info to the sub-domain with a 301 or 308 - - // TODO: Make 308 work in include/network.php for zot_fetch_url and zot_post_url - - if(($zaddr) && ($s = get_config('system','zotinfo_domainrewrite'))) { - $arr = explode('^',$s); - if(count($arr) == 2) - $zaddr = str_replace($arr[0],$arr[1],$zaddr); - } - $r = null; if(strlen($zhash)) { @@ -74,14 +63,10 @@ function zfinger_init(&$a) { */ $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash - where ( channel_pageflags & %d )>0 order by channel_id limit 1", - intval(PAGE_SYSTEM) - ); + where channel_system = 1 order by channel_id limit 1"); if(! $r) { $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash - where not ( channel_pageflags & %d )>0 order by channel_id limit 1", - intval(PAGE_REMOVED) - ); + where channel_removed = 0 order by channel_id limit 1"); } } } @@ -99,12 +84,12 @@ function zfinger_init(&$a) { $id = $e['channel_id']; - $sys_channel = (($e['channel_pageflags'] & PAGE_SYSTEM) ? true : false); + $sys_channel = (intval($e['channel_system']) ? true : false); $special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false); $adult_channel = (($e['channel_pageflags'] & PAGE_ADULT) ? true : false); $censored = (($e['channel_pageflags'] & PAGE_CENSORED) ? true : false); $searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true); - $deleted = (($e['xchan_flags'] & XCHAN_FLAGS_DELETED) ? true : false); + $deleted = (intval($e['xchan_deleted']) ? true : false); if($deleted || $censored || $sys_channel) $searchable = false; @@ -112,16 +97,15 @@ function zfinger_init(&$a) { $public_forum = false; $role = get_pconfig($e['channel_id'],'system','permissions_role'); - if($role === 'forum') { + if($role === 'forum' || $role === 'repository') { $public_forum = true; } else { // check if it has characteristics of a public forum based on custom permissions. - $t = q("select abook_my_perms from abook where abook_channel = %d and (abook_flags & %d)>0 limit 1", - intval($e['channel_id']), - intval(ABOOK_FLAG_SELF) + $t = q("select abook_my_perms from abook where abook_channel = %d and abook_self = 1 limit 1", + intval($e['channel_id']) ); - if($t && ($t[0]['abook_my_perms'] & PERMS_W_TAGWALL)) + if(($t) && (($t[0]['abook_my_perms'] & PERMS_W_TAGWALL) && (! ($t[0]['abook_my_perms'] & PERMS_W_STREAM)))) $public_forum = true; } |