[twitter] Fix Notice

This commit is contained in:
Philipp 2021-09-13 20:26:26 +02:00
parent c7771ac8c3
commit f9455b42c7
No known key found for this signature in database
GPG key ID: 24A7501396EB5432

View file

@ -497,12 +497,12 @@ function twitter_action(App $a, $uid, $pid, $action)
$post = ['id' => $pid]; $post = ['id' => $pid];
Logger::debug('before action', ['action' => $action, 'pid' => $pid, 'data' => $post]); Logger::debug('before action', ['action' => $action, 'pid' => $pid, 'data' => $post]);
$result = [];
try { try {
switch ($action) { switch ($action) {
case 'delete': case 'delete':
// To-Do: $result = $connection->post('statuses/destroy', $post); // To-Do: $result = $connection->post('statuses/destroy', $post);
$result = [];
break; break;
case 'like': case 'like':
$result = $connection->post('favorites/create', $post); $result = $connection->post('favorites/create', $post);
@ -518,7 +518,6 @@ function twitter_action(App $a, $uid, $pid, $action)
break; break;
default: default:
Logger::warning('Unhandled action', ['action' => $action]); Logger::warning('Unhandled action', ['action' => $action]);
$result = [];
} }
} catch (TwitterOAuthException $twitterOAuthException) { } catch (TwitterOAuthException $twitterOAuthException) {
Logger::warning('Unable to communicate with twitter', ['action' => $action, 'data' => $post, 'code' => $twitterOAuthException->getCode(), 'exception' => $twitterOAuthException]); Logger::warning('Unable to communicate with twitter', ['action' => $action, 'data' => $post, 'code' => $twitterOAuthException->getCode(), 'exception' => $twitterOAuthException]);