From f412f6a654992aa79738db23737239ccde6207a6 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 7 Aug 2014 17:49:57 -0700 Subject: over-ride the private flag if we received a post that isn't completely public, but they didn't set the private flag. --- include/zot.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 1e38b8b49..6ca27aa70 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1220,13 +1220,25 @@ function zot_import($arr, $sender_url) { } } - logger('public post'); + logger('public post'); // Public post. look for any site members who are or may be accepting posts from this sender // and who are allowed to see them based on the sender's permissions $deliveries = allowed_public_recips($i); + // if the scope is anything but 'public' we're going to store it as private regardless + // of the private flag on the post. + + if($i['message'] && array_key_exists('public_scope',$i['message']) + && $i['message']['public_scope'] === 'public') { + + if(! array_key_exists('flags',$i['message'])) + $i['message']['flags'] = array(); + if(! in_array('private',$i['message']['flags'])) + $i['message']['flags'][] = 'private'; + + } } // Go through the hash array and remove duplicates. array_unique() won't do this because the array is more than one level. -- cgit v1.2.3