X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDiaspora.php;h=5c6d1a2c0699552936d6540f3b23b14f930284b0;hb=785fcd5916f5e0abf2915297c9fa6e28ab5fe361;hp=4d91f8b1c0661946f183676a6e15e567fc1e6c73;hpb=4224209497a6c7f723ea2b4d989f99890bccc47f;p=friendica.git diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 4d91f8b1c0..5c6d1a2c06 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -1,6 +1,6 @@ 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"]) { @@ -1340,10 +1341,6 @@ class Diaspora if ($r) { $cid = $r[0]["id"]; $network = $r[0]["network"]; - - // We are receiving content from a user that possibly is about to be terminated - // This means the user is vital, so we remove a possible termination date. - Contact::unmarkForArchival($r[0]); } else { $cid = $contact["id"]; $network = NETWORK_DIASPORA; @@ -2211,7 +2208,7 @@ class Diaspora $image_url = "http://".$handle_parts[1].$image_url; } - update_contact_avatar($image_url, $importer["uid"], $contact["id"]); + Contact::updateAvatar($image_url, $importer["uid"], $contact["id"]); // Generic birthday. We don't know the timezone. The year is irrelevant. @@ -2250,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); @@ -2465,13 +2462,9 @@ class Diaspora logger("Author ".$author." was added as contact number ".$contact_record["id"].".", LOGGER_DEBUG); - $def_gid = get_default_group($importer['uid'], $ret["network"]); - - if (intval($def_gid)) { - group_add_member($importer["uid"], "", $contact_record["id"], $def_gid); - } + Group::addMember(User::getDefaultGroup($importer['uid'], $ret["network"]), $contact_record['id']); - update_contact_avatar($ret["photo"], $importer['uid'], $contact_record["id"], true); + Contact::updateAvatar($ret["photo"], $importer['uid'], $contact_record["id"], true); if ($importer["page-flags"] == PAGE_NORMAL) { logger("Sending intra message for author ".$author.".", LOGGER_DEBUG); @@ -2494,7 +2487,7 @@ class Diaspora logger("Does an automatic friend approval for author ".$author.".", LOGGER_DEBUG); - update_contact_avatar($contact_record["photo"], $importer["uid"], $contact_record["id"]); + Contact::updateAvatar($contact_record["photo"], $importer["uid"], $contact_record["id"]); // technically they are sharing with us (CONTACT_IS_SHARING), // but if our page-type is PAGE_COMMUNITY or PAGE_SOAPBOX