mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
New hook "support_probe"
This commit is contained in:
parent
a725815d7a
commit
970d86472e
4 changed files with 33 additions and 1 deletions
|
@ -305,4 +305,26 @@ class Protocol
|
|||
|
||||
return $hook_data['result'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the provided protocol supports probing for contacts
|
||||
*
|
||||
* @param $protocol
|
||||
* @return bool
|
||||
* @throws HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function supportsProbe($protocol): bool
|
||||
{
|
||||
if (in_array($protocol, self::NATIVE_SUPPORT)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$hook_data = [
|
||||
'protocol' => $protocol,
|
||||
'result' => null
|
||||
];
|
||||
Hook::callAll('support_probe', $hook_data);
|
||||
|
||||
return $hook_data['result'] === true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue