aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-19 23:31:26 -0800
committerfriendica <info@friendica.com>2013-02-19 23:31:26 -0800
commit7038ad2e5967e8f88341cede961c1efa3f910b15 (patch)
tree771782a985453c2fe8da0f9e76c8812deb40abde /include
parenta1921713653a9b3cb4a31daeca0cf75e65da73cd (diff)
downloadvolse-hubzilla-7038ad2e5967e8f88341cede961c1efa3f910b15.tar.gz
volse-hubzilla-7038ad2e5967e8f88341cede961c1efa3f910b15.tar.bz2
volse-hubzilla-7038ad2e5967e8f88341cede961c1efa3f910b15.zip
set xchan hidden flag correctly when local directory update
Diffstat (limited to 'include')
-rw-r--r--include/dir_fns.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index be1bcd503..2444e29ce 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -39,6 +39,26 @@ function syncdirs($uid) {
$profile['keywords'] = $tags;
}
+ $hidden = (1 - intval($p[0]['publish']));
+
+ $r = q("select xchan_flags from xchan where xchan_hash = '%s' limit 1",
+ dbesc($p[0]['channel_hash'])
+ );
+
+ // Be careful - XCHAN_FLAGS_HIDDEN should evaluate to 1
+ if(($r[0]['xchan_flags'] & XCHAN_FLAGS_HIDDEN) != $hidden)
+ $new_flags = $r[0]['xchan_flags'] ^ XCHAN_FLAGS_HIDDEN;
+ else
+ $new_flags = $r[0]['xchan_flags'];
+
+ if($new_flags != $r[0]['xchan_flags']) {
+ $r = q("update xchan set xchan_flags = %d where xchan_hash = '%s' limit 1",
+ intval($new_flags),
+ dbesc($xchan_hash)
+ );
+ }
+
+
if(perm_is_allowed($uid,'','view_profile')) {
import_directory_profile($hash,$profile);