New functions to check if a contact supports that protocol

This commit is contained in:
Michael 2019-07-27 11:09:12 +00:00
parent d75e3e1650
commit 264936100f
4 changed files with 81 additions and 17 deletions

View file

@ -194,4 +194,18 @@ class ActivityPub
ActivityPub\Receiver::processActivity($ldactivity, '', $uid, true);
}
}
/**
* Checks if the given contact url does support ActivityPub
*
* @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 = null)
{
return !empty(APContact::getByURL($url, $update));
}
}