]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Diaspora.php
Merge pull request #11260 from mkljczk/develop
[friendica.git] / src / Protocol / Diaspora.php
index d276814f5d3e21a17055d14bfd8198c5be77ec58..ea0b2b6749ab9a6b83c2749a5ad26e0c6335c156 100644 (file)
@@ -858,10 +858,6 @@ class Diaspora
                } elseif (($contact["rel"] == Contact::SHARING) || ($contact["rel"] == Contact::FRIEND)) {
                        // 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])) {
-                       // That's good
-                       return true;
                        // Is the message a global user or a comment?
                } elseif (($importer["uid"] == 0) || $is_comment) {
                        // Messages for the global users and comments are always accepted
@@ -2712,6 +2708,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;
@@ -3470,9 +3469,8 @@ class Diaspora
 
        private static function prependParentAuthorMention($body, $profile_url)
        {
-               $profile = Contact::getByURL($profile_url, false, ['addr', 'name', 'contact-type']);
+               $profile = Contact::getByURL($profile_url, false, ['addr', 'name']);
                if (!empty($profile['addr'])
-                       && $profile['contact-type'] != Contact::TYPE_COMMUNITY
                        && !strstr($body, $profile['addr'])
                        && !strstr($body, $profile_url)
                ) {