From 11b6c29a3ad3116834defee1f40028b9d7b5f295 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 4 Feb 2022 06:02:21 +0000 Subject: [PATCH] Fix for PR #11204 - Forums are now correctly detected --- src/Protocol/ActivityPub/Processor.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index d944c73a01..bd198fb30e 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -619,7 +619,16 @@ class Processor continue; } - if (!Contact::isForum($receiver) && DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) { + $is_forum = false; + + if ($receiver != 0) { + $user = User::getById($receiver, ['account-type']); + if (!empty($user['account-type'])) { + $is_forum = ($user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY); + } + } + + if (!$is_forum && 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))) {