]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Diaspora.php
Merge pull request #4036 from MrPetovan/task/3878-move-objects-to-model
[friendica.git] / src / Protocol / Diaspora.php
index cd4e5b6f0e0135980d21efa40b0c62f867ad8bcd..d6f1078f4c7f26a0c252418cd21e1aeae0238093 100644 (file)
@@ -16,10 +16,10 @@ use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
-use Friendica\Model\GlobalContact;
+use Friendica\Model\Contact;
+use Friendica\Model\GContact;
+use Friendica\Model\Profile;
 use Friendica\Network\Probe;
-use Friendica\Object\Contact;
-use Friendica\Object\Profile;
 use Friendica\Util\XML;
 
 use dba;
@@ -992,16 +992,18 @@ class Diaspora
                 * That makes us friends.
                 * Normally this should have handled by getting a request - but this could get lost
                 */
-               if ($contact["rel"] == CONTACT_IS_FOLLOWER && in_array($importer["page-flags"], array(PAGE_FREELOVE))) {
-                       dba::update(
-                               'contact',
-                               array('rel' => CONTACT_IS_FRIEND, 'writable' => true),
-                               array('id' => $contact["id"], 'uid' => $contact["uid"])
-                       );
-
-                       $contact["rel"] = CONTACT_IS_FRIEND;
-                       logger("defining user ".$contact["nick"]." as friend");
-               }
+               // 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_IS_FOLLOWER && in_array($importer["page-flags"], array(PAGE_FREELOVE))) {
+               //      dba::update(
+               //              'contact',
+               //              array('rel' => CONTACT_IS_FRIEND, 'writable' => true),
+               //              array('id' => $contact["id"], 'uid' => $contact["uid"])
+               //      );
+               //
+               //      $contact["rel"] = CONTACT_IS_FRIEND;
+               //      logger("defining user ".$contact["nick"]." as friend");
+               //}
 
                // We don't seem to like that person
                if ($contact["blocked"] || $contact["readonly"] || $contact["archive"]) {
@@ -2245,9 +2247,9 @@ class Diaspora
                                        "addr" => $author, "nick" => $nick, "keywords" => $keywords,
                                        "hide" => !$searchable, "nsfw" => $nsfw);
 
-               $gcid = GlobalContact::update($gcontact);
+               $gcid = GContact::update($gcontact);
 
-               GlobalContact::link($gcid, $importer["uid"], $contact["id"]);
+               GContact::link($gcid, $importer["uid"], $contact["id"]);
 
                logger("Profile of contact ".$contact["id"]." stored for user ".$importer["uid"], LOGGER_DEBUG);