use Friendica\Model\PermissionSet;
use Friendica\Model\Profile;
use Friendica\Model\User;
+use Friendica\Network\Probe;
use Friendica\Object\Image;
use Friendica\Util\BaseURL;
use Friendica\Util\Crypto;
$dest_url = ($public_batch ? $contact["batch"] : $contact["notify"]);
if (empty($dest_url)) {
- Logger::info('Empty destination', ['contact' => $contact]);
+ Logger::info('Empty destination', ['public' => $public_batch, 'contact' => $contact]);
return -24;
}
'location' => $contact['location'], 'addr' => $contact['addr'], 'keywords' => $contact['keywords'],
'bdyear' => $contact['bdyear'], 'bd' => $contact['bd'], 'hidden' => $contact['hidden'],
'xmpp' => $contact['xmpp'], 'name-date' => DateTimeFormat::utc($contact['name-date']),
- 'uri-date' => DateTimeFormat::utc($contact['uri-date'])];
+ 'unsearchable' => $contact['hidden'], 'uri-date' => DateTimeFormat::utc($contact['uri-date'])];
DBA::update('contact', $fields, ['id' => $contact['id'], 'network' => $contact['network']], $contact_old);
// Update the public contact. Don't set the "hidden" value, this is used differently for public contacts
unset($fields['hidden']);
- $fields['unsearchable'] = $hide;
$condition = ['uid' => 0, 'nurl' => Strings::normaliseLink($contact_old['url'])];
DBA::update('contact', $fields, $condition, true);
return (strcmp($existing_edited, $update_edited) < 0);
}
+
+ /**
+ * Checks if the given contact url does support DFRN
+ *
+ * @param string $url profile url
+ * @param boolean $update Update the profile
+ * @return boolean
+ * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ * @throws \ImagickException
+ */
+ public static function isSupportedByContactUrl($url, $update = false)
+ {
+ $probe = Probe::uri($url, Protocol::DFRN, 0, !$update);
+ return $probe['network'] == Protocol::DFRN;
+ }
}