]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Diaspora.php
Private forums are now working via ActivityPub
[friendica.git] / src / Protocol / Diaspora.php
index 5caa6c7a151147d53b296042af66c5872db6f3c3..aba79364f406ab41eccaffd256c77ea436f4c39a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -859,7 +859,7 @@ class Diaspora
                        // Yes, then it is fine.
                        return true;
                        // Is it a post to a community?
-               } elseif (($contact["rel"] == Contact::FOLLOWER) && in_array($importer["page-flags"], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
+               } elseif (($contact["rel"] == Contact::FOLLOWER) && ($importer['account-type'] == User::ACCOUNT_TYPE_COMMUNITY)) {
                        // That's good
                        return true;
                        // Is the message a global user or a comment?
@@ -2712,6 +2712,9 @@ class Diaspora
 
                        $datarray["object-type"] = Activity\ObjectType::IMAGE;
                        $datarray["post-type"] = Item::PT_IMAGE;
+               } elseif ($data->poll) {
+                       $datarray["object-type"] = Activity\ObjectType::NOTE;
+                       $datarray["post-type"] = Item::PT_POLL;
                } else {
                        $datarray["object-type"] = Activity\ObjectType::NOTE;
                        $datarray["post-type"] = Item::PT_NOTE;
@@ -4100,6 +4103,9 @@ class Diaspora
                        $item['private'] = Item::PUBLIC;
                }
 
+               // Don't trigger the addons
+               $item['api_source'] = false;
+
                return Item::insert($item, true);
        }
 }