Merge pull request #6888 from annando/issue-6167-a

Issue 6167: Don't publish non visible content
This commit is contained in:
Hypolite Petovan 2019-03-15 19:22:46 -04:00 committed by GitHub
commit 69f2556f67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 8 deletions

View file

@ -152,7 +152,7 @@ class Transmitter
$condition = ['uid' => 0, 'contact-id' => $public_contact, 'author-id' => $public_contact, $condition = ['uid' => 0, 'contact-id' => $public_contact, 'author-id' => $public_contact,
'private' => false, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'private' => false, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT],
'deleted' => false, 'visible' => true]; 'deleted' => false, 'visible' => true, 'moderated' => false];
$count = DBA::count('item', $condition); $count = DBA::count('item', $condition);
$data = ['@context' => ActivityPub::CONTEXT]; $data = ['@context' => ActivityPub::CONTEXT];

View file

@ -254,7 +254,7 @@ class DFRN
FROM `item` USE INDEX (`uid_wall_changed`) $sql_post_table FROM `item` USE INDEX (`uid_wall_changed`) $sql_post_table
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`wall` AND `item`.`changed` > '%s' WHERE `item`.`uid` = %d AND `item`.`wall` AND `item`.`changed` > '%s'
$sql_extra AND `item`.`visible` $sql_extra
ORDER BY `item`.`parent` ".$sort.", `item`.`created` ASC LIMIT 0, 300", ORDER BY `item`.`parent` ".$sort.", `item`.`created` ASC LIMIT 0, 300",
intval($owner_id), intval($owner_id),
DBA::escape($check_date), DBA::escape($check_date),

View file

@ -60,7 +60,7 @@ class Delivery extends BaseObject
} }
$parent_id = intval($item['parent']); $parent_id = intval($item['parent']);
$condition = ['id' => [$target_id, $parent_id], 'moderated' => false]; $condition = ['id' => [$target_id, $parent_id], 'visible' => true, 'moderated' => false];
$params = ['order' => ['id']]; $params = ['order' => ['id']];
$itemdata = Model\Item::select([], $condition, $params); $itemdata = Model\Item::select([], $condition, $params);

View file

@ -99,11 +99,6 @@ class Notifier
return; return;
} }
// Issue 6167: We don't distribute image uploads
if ($target_item['post-type'] == Item::PT_IMAGE) {
return;
}
if (!empty($target_item['contact-uid'])) { if (!empty($target_item['contact-uid'])) {
$uid = $target_item['contact-uid']; $uid = $target_item['contact-uid'];
} elseif (!empty($target_item['uid'])) { } elseif (!empty($target_item['uid'])) {