Issue 14153: Don't transmit activities to all participants

This commit is contained in:
Michael 2024-05-19 08:37:18 +00:00
parent a5e12c82df
commit cb0b3e67be

View file

@ -765,7 +765,7 @@ class Transmitter
}
if (!empty($item['parent']) && (!$exclusive || ($item['private'] == Item::PRIVATE))) {
if ($item['private'] == Item::PRIVATE) {
if ($item['private'] == Item::PRIVATE || $item['gravity'] == Item::GRAVITY_ACTIVITY) {
$condition = ['parent' => $item['parent'], 'uri-id' => $item['thr-parent-id']];
} else {
$condition = ['parent' => $item['parent']];
@ -814,6 +814,14 @@ class Transmitter
DBA::close($parents);
}
if (!empty($item['quote-uri-id']) && in_array($item['private'], [Item::PUBLIC, Item::UNLISTED])) {
$quoted = Post::selectFirst(['author-link'], ['uri-id' => $item['quote-uri-id']]);
$profile = APContact::getByURL($quoted['author-link'], false);
if (!empty($profile)) {
$data['cc'][] = $profile['url'];
}
}
$data['to'] = array_unique($data['to']);
$data['cc'] = array_unique($data['cc']);
$data['bcc'] = array_unique($data['bcc']);