X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FProtocol.php;h=4effa8d74b94eff2aa3f41649bb3d983fa9a70cc;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=9c5aad83d43eedc2bba60a04ebd810abc17ddd0b;hpb=69e4254dcc51345a36e13fb96f94d9b57bc37489;p=friendica.git diff --git a/src/Core/Protocol.php b/src/Core/Protocol.php index 9c5aad83d4..4effa8d74b 100644 --- a/src/Core/Protocol.php +++ b/src/Core/Protocol.php @@ -57,6 +57,7 @@ class Protocol const TWITTER = 'twit'; // Twitter const DISCOURSE = 'dscs'; // Discourse const TUMBLR = 'tmbl'; // Tumblr + const BLUESKY = 'bsky'; // Bluesky // Dead protocols const APPNET = 'apdn'; // app.net - Dead protocol @@ -305,4 +306,31 @@ 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 + { + // "Mail" can only be probed for a specific user in a specific condition, so we are ignoring it here. + if ($protocol == self::MAIL) { + return false; + } + + if (in_array($protocol, array_merge(self::NATIVE_SUPPORT, [self::ZOT, self::PHANTOM]))) { + return true; + } + + $hook_data = [ + 'protocol' => $protocol, + 'result' => null + ]; + Hook::callAll('support_probe', $hook_data); + + return $hook_data['result'] === true; + } }