]> git.mxchange.org Git - friendica.git/commitdiff
Issue 10966: Ignore "only sharer" setting for forum accounts
authorMichael <heluecht@pirati.ca>
Thu, 3 Feb 2022 20:26:30 +0000 (20:26 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 3 Feb 2022 20:26:30 +0000 (20:26 +0000)
src/Model/Contact.php
src/Protocol/ActivityPub/Processor.php

index 2afe91d134cd8109056069d61a5b6e5f9d7ec4f1..0af28a7401d4aa396d27fa8b57d2464171bf2e5e 100644 (file)
@@ -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']);
        }
 
        /**
index 4a9dc352d41639bfc21ed201d86fc650f475b476..d944c73a01c3b2d19a29a734df1a0102da653283 100644 (file)
@@ -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))) {