Merge pull request #11205 from annando/fix-forum

Fix for PR #11204 - Forums are now correctly detected
pull/11206/head
Philipp 2022-02-04 07:38:17 +01:00 committed by GitHub
commit 8357deb28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -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))) {