aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorMichael Meer <michael@meer.name>2014-01-23 08:50:27 +0100
committerMichael Meer <michael@meer.name>2014-01-23 08:50:27 +0100
commitaec78b32840e09b4a212ca075f97f9fa8d03d90e (patch)
treebe3dbad9a5eba8e92643548600e5c58deb33f033 /include/items.php
parent6a1e73e610350bf3e19354e182803329f1234a8e (diff)
parentbc98f4ddf4cdfa655385c705d97fa006ada9c49f (diff)
downloadvolse-hubzilla-aec78b32840e09b4a212ca075f97f9fa8d03d90e.tar.gz
volse-hubzilla-aec78b32840e09b4a212ca075f97f9fa8d03d90e.tar.bz2
volse-hubzilla-aec78b32840e09b4a212ca075f97f9fa8d03d90e.zip
Merge branch 'master' of https://github.com/friendica/red
to be in sync with main repro
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php33
1 files changed, 20 insertions, 13 deletions
diff --git a/include/items.php b/include/items.php
index ea46df9bf..12823c6f9 100755
--- a/include/items.php
+++ b/include/items.php
@@ -18,10 +18,17 @@ function collect_recipients($item,&$private) {
require_once('include/group.php');
- if($item['item_private'])
- $private = true;
+ $private = ((intval($item['item_private'])) ? true : false);
+ $recipients = array();
+
+ // if the post is marked private but there are no recipients, only add the author and owner
+ // as recipients. The ACL for the post may live on the hub of a different clone. We need to
+ // get the post to that hub.
if($item['allow_cid'] || $item['allow_gid'] || $item['deny_cid'] || $item['deny_gid']) {
+
+ // it is private
+
$allow_people = expand_acl($item['allow_cid']);
$allow_groups = expand_groups(expand_acl($item['allow_gid']));
@@ -54,19 +61,19 @@ function collect_recipients($item,&$private) {
$private = true;
}
else {
- $recipients = array();
- $r = q("select * from abook where abook_channel = %d and not (abook_flags & %d) and not (abook_flags & %d) and not (abook_flags & %d)",
- intval($item['uid']),
- intval(ABOOK_FLAG_SELF),
- intval(ABOOK_FLAG_PENDING),
- intval(ABOOK_FLAG_ARCHIVED)
- );
- if($r) {
- foreach($r as $rr) {
- $recipients[] = $rr['abook_xchan'];
+ if(! $private) {
+ $r = q("select abook_xchan from abook where abook_channel = %d and not (abook_flags & %d) and not (abook_flags & %d) and not (abook_flags & %d)",
+ intval($item['uid']),
+ intval(ABOOK_FLAG_SELF),
+ intval(ABOOK_FLAG_PENDING),
+ intval(ABOOK_FLAG_ARCHIVED)
+ );
+ if($r) {
+ foreach($r as $rr) {
+ $recipients[] = $rr['abook_xchan'];
+ }
}
}
- $private = false;
}
// This is a somewhat expensive operation but important.