mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-12-23 14:20:16 +00:00
Merge pull request #1228 from MrPetovan/bug/11139-twitter-follow-not-connected
[twitter] Abort follow process on API call failure
This commit is contained in:
commit
5c2071a72b
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