mirror of
https://github.com/friendica/friendica
synced 2025-04-23 10:30:11 +00:00
Don't accept private answers to public parents
This commit is contained in:
parent
59f701d5a9
commit
e3576fa0bd
2 changed files with 14 additions and 0 deletions
|
@ -264,6 +264,19 @@ class Processor
|
|||
}
|
||||
|
||||
$item['uri'] = $activity['id'];
|
||||
|
||||
if (($item['parent-uri'] != $item['uri']) && ($item['gravity'] == GRAVITY_COMMENT)) {
|
||||
$item_private = !in_array(0, $activity['item_receiver']);
|
||||
$parent = Item::selectFirst(['private'], ['uri' => $item['parent-uri']]);
|
||||
if (!DBA::isResult($parent)) {
|
||||
return;
|
||||
}
|
||||
if ($item_private && !$parent['private']) {
|
||||
Logger::log('Item ' . $item['uri'] . ' is private but the parent ' . $item['parent-uri'] . ' is not. So we drop it.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$item['created'] = $activity['published'];
|
||||
$item['edited'] = $activity['updated'];
|
||||
$item['guid'] = $activity['diaspora:guid'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue