From 695d6ce4619489d433b5311a6cde61c117552023 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 3 Feb 2022 20:26:30 +0000 Subject: [PATCH] Issue 10966: Ignore "only sharer" setting for forum accounts --- src/Model/Contact.php | 4 ++-- src/Protocol/ActivityPub/Processor.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 2afe91d134..0af28a7401 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2947,7 +2947,7 @@ class Contact */ public static function isForum($contactid) { - $fields = ['forum', 'prv']; + $fields = ['contact-type', 'forum', 'prv']; $condition = ['id' => $contactid]; $contact = DBA::selectFirst('contact', $fields, $condition); if (!DBA::isResult($contact)) { @@ -2955,7 +2955,7 @@ class Contact } // Is it a forum? - return ($contact['forum'] || $contact['prv']); + return (($contact['contact-type'] == self::TYPE_COMMUNITY) || $contact['forum'] || $contact['prv']); } /** diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 4a9dc352d4..d944c73a01 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -619,7 +619,7 @@ class Processor continue; } - if (DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) { + if (!Contact::isForum($receiver) && DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) { $skip = !Contact::isSharingByURL($activity['author'], $receiver); if ($skip && (($activity['type'] == 'as:Announce') || ($item['isForum'] ?? false))) {