]> git.mxchange.org Git - friendica-addons.git/commitdiff
[twitter] Add support for the new support_follow hook
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 15:52:24 +0000 (11:52 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 15:52:24 +0000 (11:52 -0400)
twitter/twitter.php

index 02470f9891ef83d06b0a7ab444a440ae24d0a567..f753ee97a9f42edfb5491ef2d7fd23ca990b5b13 100644 (file)
@@ -104,6 +104,7 @@ function twitter_install()
        Hook::register('notifier_normal'        , __FILE__, 'twitter_post_hook');
        Hook::register('jot_networks'           , __FILE__, 'twitter_jot_nets');
        Hook::register('cron'                   , __FILE__, 'twitter_cron');
+       Hook::register('support_follow'         , __FILE__, 'twitter_support_follow');
        Hook::register('follow'                 , __FILE__, 'twitter_follow');
        Hook::register('unfollow'               , __FILE__, 'twitter_unfollow');
        Hook::register('expire'                 , __FILE__, 'twitter_expire');
@@ -135,6 +136,13 @@ function twitter_check_item_notification(App $a, array &$notification_data)
        }
 }
 
+function twitter_support_follow(App $a, array &$data)
+{
+       if ($data['protocol'] == Protocol::TWITTER) {
+               $data['result'] = true;
+       }
+}
+
 function twitter_follow(App $a, array &$contact)
 {
        Logger::info('Check if contact is twitter contact', ['url' => $contact["url"]]);