mirror of
https://github.com/friendica/friendica
synced 2025-04-24 07:10:11 +00:00
New functions to check if a contact supports that protocol
This commit is contained in:
parent
d75e3e1650
commit
264936100f
4 changed files with 81 additions and 17 deletions
|
@ -2302,4 +2302,19 @@ class OStatus
|
|||
|
||||
return trim($doc->saveXML());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given contact url does support OStatus
|
||||
*
|
||||
* @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::OSTATUS, 0, !$update);
|
||||
return $probe['network'] == Protocol::OSTATUS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue