]> git.mxchange.org Git - friendica-addons.git/commitdiff
[twitter] Mirror the Twitter block behavior concerning established relationships
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 9 Oct 2021 05:58:37 +0000 (01:58 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 9 Oct 2021 06:05:25 +0000 (02:05 -0400)
twitter/twitter.php

index 6a4df87799ce7b94c8dc43168366466924e8d709..c443f0c281f0b2caebfb5d6fed2276ffba7032df 100644 (file)
@@ -176,6 +176,11 @@ function twitter_unfollow(App $a, array &$hook_data)
 function twitter_block(App $a, array &$hook_data)
 {
        $hook_data['result'] = twitter_api_contact('blocks/create', $hook_data['contact'], $hook_data['uid']);
+
+       if ($hook_data['result'] === true) {
+               Contact::removeFollower($hook_data['contact']);
+               Contact::unfollow($hook_data['contact']['id'], $hook_data['uid']);
+       }
 }
 
 function twitter_unblock(App $a, array &$hook_data)