Merge pull request 'Tumblr: Added support for hook "support_probe"' (#1376) from heluecht/friendica-addons:tumblr-support-probe into develop

Reviewed-on: friendica/friendica-addons#1376
This commit is contained in:
Hypolite Petovan 2023-04-27 13:59:07 +02:00
commit c4876d46b4

View file

@ -51,6 +51,7 @@ function tumblr_install()
Hook::register('connector_settings_post', __FILE__, 'tumblr_settings_post'); Hook::register('connector_settings_post', __FILE__, 'tumblr_settings_post');
Hook::register('cron', __FILE__, 'tumblr_cron'); Hook::register('cron', __FILE__, 'tumblr_cron');
Hook::register('support_follow', __FILE__, 'tumblr_support_follow'); Hook::register('support_follow', __FILE__, 'tumblr_support_follow');
Hook::register('support_probe', __FILE__, 'tumblr_support_probe');
Hook::register('follow', __FILE__, 'tumblr_follow'); Hook::register('follow', __FILE__, 'tumblr_follow');
Hook::register('unfollow', __FILE__, 'tumblr_unfollow'); Hook::register('unfollow', __FILE__, 'tumblr_unfollow');
Hook::register('block', __FILE__, 'tumblr_block'); Hook::register('block', __FILE__, 'tumblr_block');
@ -138,6 +139,13 @@ function tumblr_support_follow(array &$data)
} }
} }
function tumblr_support_probe(array &$data)
{
if ($data['protocol'] == Protocol::TUMBLR) {
$data['result'] = true;
}
}
function tumblr_follow(array &$hook_data) function tumblr_follow(array &$hook_data)
{ {
$uid = DI::userSession()->getLocalUserId(); $uid = DI::userSession()->getLocalUserId();