aboutsummaryrefslogtreecommitdiffstats
path: root/include/event.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-02-25 00:36:35 -0800
committerredmatrix <git@macgirvin.com>2016-02-25 00:36:35 -0800
commitebfa1a12b9cc3d939ed49a7f66e5687267a409d3 (patch)
tree037b47bc72ae0f4b6b195266da39bb1870481cfd /include/event.php
parent43521bb10b71752b5b3fd953056966ba30df50b6 (diff)
downloadvolse-hubzilla-ebfa1a12b9cc3d939ed49a7f66e5687267a409d3.tar.gz
volse-hubzilla-ebfa1a12b9cc3d939ed49a7f66e5687267a409d3.tar.bz2
volse-hubzilla-ebfa1a12b9cc3d939ed49a7f66e5687267a409d3.zip
when creating an event from a post in our stream, if the original post was private, set the event permissions to "just me". If it was a public event, set the event permissions to the channel default permissions.
Diffstat (limited to 'include/event.php')
-rw-r--r--include/event.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/event.php b/include/event.php
index 73033a1c3..2969f4f61 100644
--- a/include/event.php
+++ b/include/event.php
@@ -440,6 +440,17 @@ function event_addtocal($item_id, $uid) {
$ev['event_hash'] = $item['resource_id'];
}
+ if($ev->private)
+ $ev['allow_cid'] = '<' . $channel['channel_hash'] . '>';
+ else {
+ $acl = new Zotlabs\Access\AccessList($channel);
+ $x = $acl->get();
+ $ev['allow_cid'] = $x['allow_cid'];
+ $ev['allow_gid'] = $x['allow_gid'];
+ $ev['deny_cid'] = $x['deny_cid'];
+ $ev['deny_gid'] = $x['deny_gid'];
+ }
+
$event = event_store_event($ev);
if($event) {
$r = q("update item set resource_id = '%s', resource_type = 'event' where id = %d and uid = %d",