Merge pull request #14168 from annando/issue-14153

Issue 14153: Don't transmit activities to all participants
This commit is contained in:
Tobias Diekershoff 2024-05-19 13:52:10 +02:00 committed by GitHub
commit 4b3498710f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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']);