Rename Model\GlobalContact to Model\GContact

This commit is contained in:
Hypolite Petovan 2017-12-07 09:09:28 -05:00
commit cd84bf8963
23 changed files with 71 additions and 71 deletions

View file

@ -23,7 +23,7 @@ require_once 'include/html2bbcode.php';
/**
* @brief This class handles GlobalContact related functions
*/
class GlobalContact
class GContact
{
/**
* @brief Search global contact table by nick or name

View file

@ -14,7 +14,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GlobalContact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use Friendica\Object\Image;
use Friendica\Protocol\OStatus;
@ -1678,9 +1678,9 @@ class DFRN
$poco["photo"] = $author["avatar"];
$poco["hide"] = $hide;
$poco["contact-type"] = $contact["contact-type"];
$gcid = GlobalContact::update($poco);
$gcid = GContact::update($poco);
GlobalContact::link($gcid, $importer["uid"], $contact["id"]);
GContact::link($gcid, $importer["uid"], $contact["id"]);
}
return($author);

View file

@ -17,7 +17,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GlobalContact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Util\XML;
@ -2245,9 +2245,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);

View file

@ -10,7 +10,7 @@ use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GlobalContact;
use Friendica\Model\GContact;
use Friendica\Network\Probe;
use Friendica\Object\Image;
use Friendica\Util\Lock;
@ -226,9 +226,9 @@ class OStatus
$contact["generation"] = 2;
$contact["hide"] = false; // OStatus contacts are never hidden
$contact["photo"] = $author["author-avatar"];
$gcid = GlobalContact::update($contact);
$gcid = GContact::update($contact);
GlobalContact::link($gcid, $contact["uid"], $contact["id"]);
GContact::link($gcid, $contact["uid"], $contact["id"]);
}
return $author;

View file

@ -12,7 +12,7 @@ namespace Friendica\Protocol;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\GlobalContact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
use dba;
@ -192,10 +192,10 @@ class PortableContact
"generation" => $generation);
try {
$gcontact = GlobalContact::sanitize($gcontact);
$gcid = GlobalContact::update($gcontact);
$gcontact = GContact::sanitize($gcontact);
$gcid = GContact::update($gcontact);
GlobalContact::link($gcid, $uid, $cid, $zcid);
GContact::link($gcid, $uid, $cid, $zcid);
} catch (Exception $e) {
logger($e->getMessage(), LOGGER_DEBUG);
}
@ -424,7 +424,7 @@ class PortableContact
$contact = array_merge($contact, $noscrape);
GlobalContact::update($contact);
GContact::update($contact);
if (trim($noscrape["updated"]) != "") {
q(
@ -446,7 +446,7 @@ class PortableContact
if (!$force && !self::updateNeeded($gcontacts[0]["created"], $gcontacts[0]["updated"], $gcontacts[0]["last_failure"], $gcontacts[0]["last_contact"])) {
logger("Profile ".$profile." was last updated at ".$gcontacts[0]["updated"]." (cached)", LOGGER_DEBUG);
GlobalContact::update($contact);
GContact::update($contact);
return $gcontacts[0]["updated"];
}
@ -467,8 +467,8 @@ class PortableContact
$gcontact["server_url"] = $data["baseurl"];
try {
$gcontact = GlobalContact::sanitize($gcontact);
GlobalContact::update($gcontact);
$gcontact = GContact::sanitize($gcontact);
GContact::update($gcontact);
self::lastUpdated($data["url"], $force);
} catch (Exception $e) {
@ -494,7 +494,7 @@ class PortableContact
$contact["server_url"] = $data["baseurl"];
GlobalContact::update($contact);
GContact::update($contact);
$feedret = z_fetch_url($data["poll"]);
@ -1600,8 +1600,8 @@ class PortableContact
"generation" => $generation);
try {
$gcontact = GlobalContact::sanitize($gcontact);
GlobalContact::update($gcontact);
$gcontact = GContact::sanitize($gcontact);
GContact::update($gcontact);
} catch (Exception $e) {
logger($e->getMessage(), LOGGER_DEBUG);
}

View file

@ -11,7 +11,7 @@ use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GlobalContact;
use Friendica\Model\GContact;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
use dba;
@ -280,7 +280,7 @@ class CronJobs
$r = q("SELECT `uid` FROM `user` WHERE `verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired`");
if (DBM::is_result($r)) {
foreach ($r AS $user) {
GlobalContact::updateForUser($user["uid"]);
GContact::updateForUser($user["uid"]);
}
}

View file

@ -8,7 +8,7 @@ use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\GlobalContact;
use Friendica\Model\GContact;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
@ -90,7 +90,7 @@ class DiscoverPoCo {
}
logger($result, LOGGER_DEBUG);
} elseif ($mode == 3) {
GlobalContact::updateSuggestions();
GContact::updateSuggestions();
} elseif (($mode == 2) && Config::get('system', 'poco_completion')) {
self::discoverUsers();
} elseif (($mode == 1) && ($search != "") && Config::get('system', 'poco_local_search')) {
@ -102,7 +102,7 @@ class DiscoverPoCo {
// Query GNU Social servers for their users ("statistics" addon has to be enabled on the GS server)
if (!Config::get('system', 'ostatus_disabled')) {
GlobalContact::discoverGsUsers();
GContact::discoverGsUsers();
}
}
@ -256,7 +256,7 @@ class DiscoverPoCo {
$data["server_url"] = $data["baseurl"];
GlobalContact::update($data);
GContact::update($data);
} else {
logger("Profile ".$jj->url." is not responding or no Friendica contact - but network ".$data["network"], LOGGER_DEBUG);
}
@ -297,7 +297,7 @@ class DiscoverPoCo {
$contact = Probe::uri($user->site_address."/".$user->name);
if ($contact["network"] != NETWORK_PHANTOM) {
$contact["about"] = $user->description;
GlobalContact::update($contact);
GContact::update($contact);
}
}
}

View file

@ -8,7 +8,7 @@ namespace Friendica\Worker;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\GlobalContact;
use Friendica\Model\GContact;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
@ -47,7 +47,7 @@ class GProbe {
}
if (!in_array($arr["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) {
GlobalContact::update($arr);
GContact::update($arr);
}
$r = q(