aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Willingham <beardyunixer@beardyunixer.com>2014-09-15 01:41:04 +0100
committerThomas Willingham <beardyunixer@beardyunixer.com>2014-09-15 01:41:04 +0100
commitb019cbb88af73e9c27bdc261ab38b86d0fa6c39a (patch)
treeca569ed5156f66bafe157331bcfb7f672c4e1cf0
parent6416a61c41d604f88625f583c8b5052eb1b3f512 (diff)
parent0a5f0fe10bf7310666b96102e8e0da754d6ca439 (diff)
downloadvolse-hubzilla-b019cbb88af73e9c27bdc261ab38b86d0fa6c39a.tar.gz
volse-hubzilla-b019cbb88af73e9c27bdc261ab38b86d0fa6c39a.tar.bz2
volse-hubzilla-b019cbb88af73e9c27bdc261ab38b86d0fa6c39a.zip
Merge branch 'master' of https://github.com/friendica/red
-rwxr-xr-xinclude/items.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index 166303cac..beec65d8a 100755
--- a/include/items.php
+++ b/include/items.php
@@ -68,13 +68,31 @@ function collect_recipients($item,&$private_envelope) {
$private_envelope = false;
if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') {
- $r = q("select abook_xchan from abook where abook_channel = %d and not (abook_flags & %d) ",
+ $r = q("select abook_xchan, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d) ",
intval($item['uid']),
intval(ABOOK_FLAG_SELF|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED)
);
if($r) {
+
+ // filter out restrictive public_policy settings from remote networks
+ // which don't have this concept and will treat them as public.
+
+ $policy = substr($item['public_policy'],0,3);
foreach($r as $rr) {
- $recipients[] = $rr['abook_xchan'];
+ switch($policy) {
+ case 'net':
+ case 'aut':
+ case 'sit':
+ case 'any':
+ case 'con':
+ if($rr['xchan_network'] != 'zot')
+ break;
+ case 'pub':
+ case '':
+ default:
+ $recipients[] = $rr['abook_xchan'];
+ break;
+ }
}
}
}