]> git.mxchange.org Git - friendica-addons.git/commitdiff
[twitter] Fix Notice
authorPhilipp <admin@philipp.info>
Mon, 13 Sep 2021 18:26:26 +0000 (20:26 +0200)
committerPhilipp <admin@philipp.info>
Mon, 13 Sep 2021 18:26:26 +0000 (20:26 +0200)
twitter/twitter.php

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