use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\GContact;
+use Friendica\Model\Contact;
+use Friendica\Model\GServer;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
use Friendica\Util\DateTimeFormat;
if ($mode == 8) {
if ($param1 != "") {
- PortableContact::lastUpdated($param1, true);
+ GContact::updateFromProbe($param1, true);
}
} elseif ($mode == 7) {
if (!empty($param4)) {
return;
}
$result = "Checking server ".$server_url." - ";
- $ret = PortableContact::checkServer($server_url);
+ $ret = GServer::check($server_url);
if ($ret) {
$result .= "success";
} else {
} elseif (($mode == 1) && ($search != "") && Config::get('system', 'poco_local_search')) {
self::discoverDirectory($search);
self::gsSearchUser($search);
- } elseif (($mode == 0) && ($search == "") && (Config::get('system', 'poco_discovery') > 0)) {
+ } elseif (($mode == 0) && ($search == "") && (Config::get('system', 'poco_discovery') != PortableContact::DISABLED)) {
// Query Friendica and Hubzilla servers for their users
PortableContact::discover();
continue;
}
- $server_url = PortableContact::detectServer($user["url"]);
+ $server_url = Contact::getBasepath($user["url"]);
$force_update = false;
if ($user["server_url"] != "") {
$server_url = $user["server_url"];
}
- if ((($server_url == "") && ($user["network"] == Protocol::FEED)) || $force_update || PortableContact::checkServer($server_url, $user["network"])) {
+ if ((($server_url == "") && ($user["network"] == Protocol::FEED)) || $force_update || GServer::check($server_url, $user["network"])) {
Logger::log('Check profile '.$user["url"]);
Worker::add(PRIORITY_LOW, "DiscoverPoCo", "check_profile", $user["url"]);
continue;
}
// Update the contact
- PortableContact::lastUpdated($jj->url);
+ GContact::updateFromProbe($jj->url);
continue;
}
- $server_url = PortableContact::detectServer($jj->url);
+ $server_url = Contact::getBasepath($jj->url);
if ($server_url != '') {
- if (!PortableContact::checkServer($server_url)) {
+ if (!GServer::check($server_url)) {
Logger::log("Friendica server ".$server_url." doesn't answer.", Logger::DEBUG);
continue;
}