aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-02-26 11:17:21 +0100
committerMario Vavti <mario@mariovavti.com>2016-02-26 11:17:21 +0100
commit5a563b8e76bbb8e4c8747831fccf8975083db16d (patch)
tree59bec71dd7e80f38ff29ba8851263142ee9606d4 /include
parent0653a2e0a9843fdcb8fd079197e5ada975b2cb05 (diff)
downloadvolse-hubzilla-5a563b8e76bbb8e4c8747831fccf8975083db16d.tar.gz
volse-hubzilla-5a563b8e76bbb8e4c8747831fccf8975083db16d.tar.bz2
volse-hubzilla-5a563b8e76bbb8e4c8747831fccf8975083db16d.zip
some improvement for file activity
Diffstat (limited to 'include')
-rw-r--r--include/attach.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/attach.php b/include/attach.php
index 29daa26ac..10ff9f13f 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1313,7 +1313,7 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
intval($channel_id)
);
- file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', $notify=0);
+ file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', $notify=1);
}
/**
@@ -1557,6 +1557,8 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
$u_arr_deny_cid = array_unique(array_merge($arr_deny_cid, expand_acl($object['deny_cid'])));
$u_arr_deny_gid = array_unique(array_merge($arr_deny_gid, expand_acl($object['deny_gid'])));
+ $private = (($u_arr_allow_cid[0] || $u_arr_allow_gid[0] || $u_arr_deny_cid[0] || $u_arr_deny_gid[0]) ? 1 : 0);
+
$u_mid = item_message_id();
$arr['aid'] = get_account_id();
@@ -1566,13 +1568,12 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
$arr['author_xchan'] = $poster['xchan_hash'];
$arr['owner_xchan'] = $poster['xchan_hash'];
$arr['title'] = '';
- //updates should be visible to everybody -> perms may have changed
- $arr['allow_cid'] = '';
- $arr['allow_gid'] = '';
- $arr['deny_cid'] = '';
- $arr['deny_gid'] = '';
+ $arr['allow_cid'] = perms2str($u_arr_allow_cid);
+ $arr['allow_gid'] = perms2str($u_arr_allow_gid);
+ $arr['deny_cid'] = perms2str($u_arr_deny_cid);
+ $arr['deny_gid'] = perms2str($u_arr_deny_gid);
$arr['item_hidden'] = 1;
- $arr['item_private'] = 0;
+ $arr['item_private'] = $private;
$arr['verb'] = ACTIVITY_UPDATE;
$arr['obj_type'] = $objtype;
$arr['object'] = $u_jsonobject;