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;
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) {
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;
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) {
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;
$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];