Merge pull request #7917 from annando/no-mention-on-private

Fix: Don't automatically mention a post creator on private posts
This commit is contained in:
Hypolite Petovan 2019-12-07 16:52:37 -05:00 committed by GitHub
commit 916af997c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -381,16 +381,16 @@ class Transmitter
$terms = Term::tagArrayFromItemId($item['id'], [Term::MENTION, Term::IMPLICIT_MENTION]); $terms = Term::tagArrayFromItemId($item['id'], [Term::MENTION, Term::IMPLICIT_MENTION]);
// Directly mention the original author upon a quoted reshare.
// Else just ensure that the original author receives the reshare.
$announce = self::getAnnounceArray($item);
if (!empty($announce['comment'])) {
$data['to'][] = $announce['actor']['url'];
} elseif (!empty($announce)) {
$data['cc'][] = $announce['actor']['url'];
}
if (!$item['private']) { if (!$item['private']) {
// Directly mention the original author upon a quoted reshare.
// Else just ensure that the original author receives the reshare.
$announce = self::getAnnounceArray($item);
if (!empty($announce['comment'])) {
$data['to'][] = $announce['actor']['url'];
} elseif (!empty($announce)) {
$data['cc'][] = $announce['actor']['url'];
}
$data = array_merge($data, self::fetchPermissionBlockFromConversation($item)); $data = array_merge($data, self::fetchPermissionBlockFromConversation($item));
$data['to'][] = ActivityPub::PUBLIC_COLLECTION; $data['to'][] = ActivityPub::PUBLIC_COLLECTION;