Merge pull request #8357 from annando/private

Support unlisted public posts
This commit is contained in:
Hypolite Petovan 2020-03-03 01:19:07 -05:00 committed by GitHub
commit dd613cda45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 183 additions and 156 deletions

View file

@ -176,7 +176,7 @@ class Delivery
&& empty($parent['allow_gid'])
&& empty($parent['deny_cid'])
&& empty($parent['deny_gid'])
&& !$parent["private"]) {
&& ($parent["private"] != Model\Item::PRIVATE)) {
$public_message = true;
}
}

View file

@ -151,6 +151,8 @@ class Notifier
// If this is a public conversation, notify the feed hub
$public_message = true;
$unlisted = false;
// Do a PuSH
$push_notify = false;
@ -183,6 +185,8 @@ class Notifier
Logger::info('Threaded comment', ['diaspora_delivery' => (int)$diaspora_delivery]);
}
$unlisted = $target_item['private'] == Item::UNLISTED;
// This is IMPORTANT!!!!
// We will only send a "notify owner to relay" or followup message if the referenced post
@ -245,8 +249,7 @@ class Notifier
Logger::info('Followup', ['target' => $target_id, 'guid' => $target_item['guid'], 'to' => $parent['contact-id']]);
//if (!$target_item['private'] && $target_item['wall'] &&
if (!$target_item['private'] &&
if (($target_item['private'] != Item::PRIVATE) &&
(strlen($target_item['allow_cid'].$target_item['allow_gid'].
$target_item['deny_cid'].$target_item['deny_gid']) == 0))
$push_notify = true;
@ -410,7 +413,7 @@ class Notifier
if ($public_message && !in_array($cmd, [Delivery::MAIL, Delivery::SUGGESTION]) && !$followup) {
$relay_list = [];
if ($diaspora_delivery) {
if ($diaspora_delivery && !$unlisted) {
$batch_delivery = true;
$relay_list_stmt = DBA::p(

View file

@ -657,11 +657,11 @@ class OnePoll
$datarray['owner-avatar'] = $contact['photo'];
if ($datarray['parent-uri'] === $datarray['uri']) {
$datarray['private'] = 1;
$datarray['private'] = Item::PRIVATE;
}
if (!DI::pConfig()->get($importer_uid, 'system', 'allow_public_email_replies')) {
$datarray['private'] = 1;
$datarray['private'] = Item::PRIVATE;
$datarray['allow_cid'] = '<' . $contact['id'] . '>';
}