aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-17 17:38:43 -0700
committerfriendica <info@friendica.com>2013-09-17 17:38:43 -0700
commit9d718ac5290506e08222c62e2fd36026256fba41 (patch)
tree2e9583292f6dfb0f1b6b971e629b3789d16e01e3 /mod/item.php
parent6a9e86e540085ea804b3a49529cf7b57c8f3669e (diff)
downloadvolse-hubzilla-9d718ac5290506e08222c62e2fd36026256fba41.tar.gz
volse-hubzilla-9d718ac5290506e08222c62e2fd36026256fba41.tar.bz2
volse-hubzilla-9d718ac5290506e08222c62e2fd36026256fba41.zip
sync photo permissions with the attached item whenever they change.
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/mod/item.php b/mod/item.php
index 367a0c4be..895784ff9 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -1087,12 +1087,15 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body,
intval($uid)
);
if($r) {
- $r = q("UPDATE item SET allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s'
+ $private = (($str_contact_allow || $str_group_allow || $str_contact_deny || $str_group_deny) ? true : false);
+
+ $r = q("UPDATE item SET allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', item_private = %d
WHERE id = %d AND uid = %d limit 1",
dbesc($str_contact_allow),
dbesc($str_group_allow),
dbesc($str_contact_deny),
dbesc($str_group_deny),
+ intval($private),
intval($r[0]['id']),
intval($uid)
);