From a5c3ef99ef2e535da6323d4fa7c7e72c31424749 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 Jul 2019 17:55:03 +0000 Subject: [PATCH] Don't store non federated contacts in gcontact --- pumpio/pumpio.php | 19 ------------------- statusnet/statusnet.php | 7 ------- twitter/twitter.php | 7 ------- 3 files changed, 33 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index c4093f2b8..cb295b893 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -18,7 +18,6 @@ use Friendica\Core\Protocol; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Contact; -use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\User; @@ -1011,24 +1010,6 @@ function pumpio_dolike(App $a, $uid, $self, $post, $own_id, $threadcompletion = function pumpio_get_contact($uid, $contact, $no_insert = false) { - $gcontact = ["url" => $contact->url, "network" => Protocol::PUMPIO, "generation" => 2, - "name" => $contact->displayName, "hide" => true, - "nick" => $contact->preferredUsername, - "addr" => str_replace("acct:", "", $contact->id)]; - - if (!empty($contact->location->displayName)) { - $gcontact["location"] = $contact->location->displayName; - } - - if (!empty($contact->summary)) { - $gcontact["about"] = $contact->summary; - } - - if (!empty($contact->image->url)) { - $gcontact["photo"] = $contact->image->url; - } - - GContact::update($gcontact); $cid = Contact::getIdForURL($contact->url, $uid); if ($no_insert) { diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 583eff880..ed7b87d83 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -51,7 +51,6 @@ use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Model\Contact; -use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\ItemContent; @@ -945,12 +944,6 @@ function statusnet_fetch_contact($uid, $contact, $create_user) return -1; } - GContact::update(["url" => $contact->statusnet_profile_url, - "network" => Protocol::STATUSNET, "photo" => $contact->profile_image_url, - "name" => $contact->name, "nick" => $contact->screen_name, - "location" => $contact->location, "about" => $contact->description, - "addr" => statusnet_address($contact), "generation" => 3]); - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `alias` = '%s' AND `network` = '%s'LIMIT 1", intval($uid), DBA::escape(Strings::normaliseLink($contact->statusnet_profile_url)), DBA::escape(Protocol::STATUSNET)); if (!DBA::isResult($r) && !$create_user) { diff --git a/twitter/twitter.php b/twitter/twitter.php index faf814da9..dd2241abf 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -79,7 +79,6 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Contact; use Friendica\Model\Conversation; -use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\ItemContent; @@ -1005,12 +1004,6 @@ function twitter_fetch_contact($uid, $data, $create_user) $url = "https://twitter.com/" . $data->screen_name; $addr = $data->screen_name . "@twitter.com"; - GContact::update(["url" => $url, "network" => Protocol::TWITTER, - "photo" => $avatar, "hide" => true, - "name" => $data->name, "nick" => $data->screen_name, - "location" => $data->location, "about" => $data->description, - "addr" => $addr, "generation" => 2]); - $fields = ['url' => $url, 'network' => Protocol::TWITTER, 'name' => $data->name, 'nick' => $data->screen_name, 'addr' => $addr, 'location' => $data->location, 'about' => $data->description];