aboutsummaryrefslogtreecommitdiffstats
path: root/mod/zfinger.php
diff options
context:
space:
mode:
authorOlivier van Helden <olivier@van-helden.net>2014-12-03 17:54:07 -0400
committerOlivier van Helden <olivier@van-helden.net>2014-12-03 17:54:07 -0400
commite523061b7261439a71bdacf8f46d4c614740b356 (patch)
tree1a0577c64197c4289ed154d2c2d5fdf48a7e5192 /mod/zfinger.php
parent13fd91d6f5723774a1b96257f8096acb2873b4ed (diff)
parentb71b45aafc618d32d23c099a4d4db8bad2f09e54 (diff)
downloadvolse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.tar.gz
volse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.tar.bz2
volse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.zip
Merge pull request #1 from friendica/master
Merge master from friendica
Diffstat (limited to 'mod/zfinger.php')
-rw-r--r--mod/zfinger.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 666f141ec..6f4febc6f 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -74,12 +74,12 @@ function zfinger_init(&$a) {
*/
$r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash
- where ( channel_pageflags & %d ) order by channel_id limit 1",
+ where ( channel_pageflags & %d )>0 order by channel_id limit 1",
intval(PAGE_SYSTEM)
);
if(! $r) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash
- where not ( channel_pageflags & %d ) order by channel_id limit 1",
+ where not ( channel_pageflags & %d )>0 order by channel_id limit 1",
intval(PAGE_REMOVED)
);
}
@@ -108,6 +108,21 @@ function zfinger_init(&$a) {
if($deleted || $censored)
$searchable = false;
+ $public_forum = false;
+
+ $role = get_pconfig($e['channel_id'],'system','permissions_role');
+ if($role === 'forum') {
+ $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)
+ );
+ if($t && ($t[0]['abook_my_perms'] & PERMS_W_TAGWALL))
+ $public_forum = true;
+ }
// This is for birthdays and keywords, but must check access permissions
@@ -174,6 +189,7 @@ function zfinger_init(&$a) {
$ret['target_sig'] = $zsig;
$ret['searchable'] = $searchable;
$ret['adult_content'] = $adult_channel;
+ $ret['public_forum'] = $public_forum;
if($deleted)
$ret['deleted'] = $deleted;