[twitter] Abort follow process on API call failure
- Prevents users without a connected Twitter account from visibly following a Twitter contact
This commit is contained in:
parent
5df88741f2
commit
e46bff23d5
1 changed files with 4 additions and 1 deletions
|
@ -157,7 +157,10 @@ function twitter_follow(App $a, array &$contact)
|
|||
|
||||
$uid = $a->getLoggedInUserId();
|
||||
|
||||
twitter_api_contact('friendships/create', ['network' => Protocol::TWITTER, 'nick' => $nickname], $uid);
|
||||
if (!twitter_api_contact('friendships/create', ['network' => Protocol::TWITTER, 'nick' => $nickname], $uid)) {
|
||||
$contact = null;
|
||||
return;
|
||||
}
|
||||
|
||||
$user = twitter_fetchuser($nickname);
|
||||
|
||||
|
|
Loading…
Reference in a new issue