mirror of
https://github.com/friendica/friendica
synced 2025-04-26 17:50:11 +00:00
Merge pull request #7434 from annando/contact-protocol
New functions to check if a contact supports that protocol
This commit is contained in:
commit
8b344141da
4 changed files with 81 additions and 17 deletions
|
@ -29,6 +29,7 @@ use Friendica\Model\Mail;
|
|||
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;
|
||||
|
@ -3041,4 +3042,19 @@ class DFRN
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue