[twitter] Add data to the unfollow hook result key
This commit is contained in:
parent
b732cf8968
commit
250dafd2b6
1 changed files with 2 additions and 0 deletions
|
@ -197,8 +197,10 @@ function twitter_unfollow(App $a, array &$hook_data)
|
||||||
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
|
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
|
||||||
$result = $connection->post('friendships/destroy', ['screen_name' => $contact['nick']]);
|
$result = $connection->post('friendships/destroy', ['screen_name' => $contact['nick']]);
|
||||||
Logger::info('[twitter] API call "friendship/destroy" successful', ['result' => $result]);
|
Logger::info('[twitter] API call "friendship/destroy" successful', ['result' => $result]);
|
||||||
|
$hook_data['result'] = true;
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
Logger::notice('[twitter] API call "friendships/destroy" failed', ['uid' => $uid, 'url' => $contact['url'], 'exception' => $e]);
|
Logger::notice('[twitter] API call "friendships/destroy" failed', ['uid' => $uid, 'url' => $contact['url'], 'exception' => $e]);
|
||||||
|
$hook_data['result'] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue