[twitter] Abort follow process on API call failure #1228

Merged
MrPetovan merged 1 commit from bug/11139-twitter-follow-not-connected into 2021.12-rc 2022-01-07 14:24:39 +01:00
Showing only changes of commit e46bff23d5 - Show all commits

View file

@ -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);