aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-08-07 17:49:57 -0700
committerfriendica <info@friendica.com>2014-08-07 17:49:57 -0700
commitf412f6a654992aa79738db23737239ccde6207a6 (patch)
tree0a819e9ba91a530a2868d744b073c156f641d3bd /include
parent640dbdf5e9c5b271cdfe578267963a8aa7729d82 (diff)
downloadvolse-hubzilla-f412f6a654992aa79738db23737239ccde6207a6.tar.gz
volse-hubzilla-f412f6a654992aa79738db23737239ccde6207a6.tar.bz2
volse-hubzilla-f412f6a654992aa79738db23737239ccde6207a6.zip
over-ride the private flag if we received a post that isn't completely public, but they didn't set the private flag.
Diffstat (limited to 'include')
-rw-r--r--include/zot.php14
1 files changed, 13 insertions, 1 deletions
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.