Replace "Probe::uri" with "Contact::getByURL"

This commit is contained in:
Michael 2020-07-16 10:22:14 +00:00
parent c352af8eda
commit d6bf7f2cda
7 changed files with 18 additions and 20 deletions

View file

@ -294,7 +294,7 @@ function dfrn_request_post(App $a)
$hcard = '';
// Detect the network
$data = Probe::uri($url);
$data = Contact::getByURL($url);
$network = $data["network"];
// Canonicalize email-style profile locator

View file

@ -23,7 +23,6 @@ use Friendica\App;
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)
@ -47,7 +46,7 @@ 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.');
@ -88,7 +87,7 @@ function ostatus_subscribe_content(App $a)
$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']) {