$hcard = '';
// Detect the network
- $data = Probe::uri($url);
+ $data = Contact::getByURL($url);
$network = $data["network"];
// Canonicalize email-style profile locator
use Friendica\Core\Protocol;
use Friendica\DI;
use Friendica\Model\Contact;
-use Friendica\Network\Probe;
use Friendica\Util\Network;
function ostatus_subscribe_content(App $a)
return $o . DI::l10n()->t('No contact provided.');
}
- $contact = Probe::uri($_REQUEST['url']);
+ $contact = Contact::getByURL($_REQUEST['url']);
if (!$contact) {
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . DI::l10n()->t('Couldn\'t fetch information for contact.');
$o .= '<p>' . $counter . '/' . $total . ': ' . $url;
- $probed = Probe::uri($url);
+ $probed = Contact::getByURL($url);
if ($probed['network'] == Protocol::OSTATUS) {
$result = Contact::createFromProbe($a->user, $probed['url'], true, Protocol::OSTATUS);
if ($result['success']) {
use Friendica\Core\System;
use Friendica\Protocol\PortableContact;
use Friendica\Protocol\Diaspora;
-use Friendica\Network\Probe;
/**
* This class handles GServer related functions
}
foreach ($contacts as $contact) {
- $probed = Probe::uri($contact);
- if (in_array($probed['network'], Protocol::FEDERATED)) {
+ $probed = Contact::getByURL($contact);
+ if (!empty($probed) && in_array($probed['network'], Protocol::FEDERATED)) {
$serverdata['network'] = $probed['network'];
break;
}
use Friendica\DI;
use Friendica\Database\DBA;
use Friendica\Model\Notify\Type;
-use Friendica\Network\Probe;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Worker\Delivery;
$guid = System::createUUID();
$uri = Item::newURI(local_user(), $guid);
- $me = Probe::uri($replyto);
+ $me = Contact::getByURL($replyto);
if (!$me['name']) {
return -2;
}
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\Network\Probe;
use Friendica\Core\System;
+use Friendica\Model\Contact;
/**
* Redirects to another URL based on the parameter 'addr'
$addr = trim($_GET['addr'] ?? '');
if ($addr) {
- $url = Probe::uri($addr)['url'] ?? '';
+ $url = Contact::getByURL($addr)['url'] ?? '';
if ($url) {
- System::externalRedirect($url);
+ System::externalRedirect($url['url']);
exit();
}
}
use Friendica\Core\Renderer;
use Friendica\Core\Search;
use Friendica\Core\System;
+use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
}
// Detect the network, make sure the provided URL is valid
- $data = Probe::uri($url);
- if ($data['network'] == Protocol::PHANTOM) {
+ $data = Contact::getByURL($url);
+ if (!$data) {
notice(DI::l10n()->t("The provided profile link doesn't seem to be valid"));
return;
}
// Send a salmon to the parent author
$probed_contact = DBA::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['author-id']]);
if (DBA::isResult($probed_contact) && !empty($probed_contact["notify"])) {
- Logger::log('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
+ Logger::notice('Notify parent author', ['url' => $probed_contact["url"], 'notify' => $probed_contact["notify"]]);
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
}
// Send a salmon to the parent owner
$probed_contact = DBA::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['owner-id']]);
if (DBA::isResult($probed_contact) && !empty($probed_contact["notify"])) {
- Logger::log('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
+ Logger::notice('Notify parent owner', ['url' => $probed_contact["url"], 'notify' => $probed_contact["notify"]]);
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
}
// Send a salmon notification to every person we mentioned in the post
foreach (Tag::getByURIId($target_item['uri-id'], [Tag::MENTION, Tag::EXCLUSIVE_MENTION, Tag::IMPLICIT_MENTION]) as $tag) {
- $probed_contact = Probe::uri($tag['url']);
- if ($probed_contact["notify"] != "") {
- Logger::log('Notify mentioned user '.$probed_contact["url"].': '.$probed_contact["notify"]);
- $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
+ $probed_contact = Contact::getByURL($tag['url']);
+ if (!empty($probed_contact['notify'])) {
+ Logger::notice('Notify mentioned user', ['url' => $probed_contact["url"], 'notify' => $probed_contact["notify"]]);
+ $url_recipients[$probed_contact['notify']] = $probed_contact['notify'];
}
}