]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Diaspora.php
Merge pull request #11270 from MrPetovan/task/10862-move-unfollow-worker
[friendica.git] / src / Protocol / Diaspora.php
index 45879df2aef340a08a4ccfc8afa022ac79be35a5..ad8e2bbef8d28d5c983ba9f2001c831e736e71cd 100644 (file)
@@ -837,8 +837,7 @@ class Diaspora
                // It is deactivated by now, due to side effects. See issue https://github.com/friendica/friendica/pull/4033
                // It is not removed by now. Possibly the code is needed?
                //if (!$is_comment && $contact["rel"] == Contact::FOLLOWER && in_array($importer["page-flags"], array(User::PAGE_FLAGS_FREELOVE))) {
-               //      DBA::update(
-               //              'contact',
+               //      Contact::update(
                //              array('rel' => Contact::FRIEND, 'writable' => true),
                //              array('id' => $contact["id"], 'uid' => $contact["uid"])
                //      );
@@ -858,10 +857,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
@@ -2127,8 +2122,7 @@ class Diaspora
        private static function receiveRequestMakeFriend(array $importer, array $contact)
        {
                if ($contact["rel"] == Contact::SHARING) {
-                       DBA::update(
-                               'contact',
+                       Contact::update(
                                ['rel' => Contact::FRIEND, 'writable' => true],
                                ['id' => $contact["id"], 'uid' => $importer["uid"]]
                        );
@@ -3473,9 +3467,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)
                ) {