[twitter] Mirror the Twitter block behavior concerning established relationships

This commit is contained in:
Hypolite Petovan 2021-10-09 01:58:37 -04:00
parent 52828b2b45
commit d37f779908

View File

@ -176,6 +176,11 @@ function twitter_unfollow(App $a, array &$hook_data)
function twitter_block(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']); $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) function twitter_unblock(App $a, array &$hook_data)