]> git.mxchange.org Git - friendica-addons.git/commitdiff
[twitter] Add data to the unfollow hook result key
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Sep 2021 14:34:31 +0000 (10:34 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Sep 2021 14:34:31 +0000 (10:34 -0400)
twitter/twitter.php

index 948de3bacf30d5bf95ffc0e867f04d9946774e50..f8da6cc48d8445eef7a4dac581b9220f153c9cd3 100644 (file)
@@ -197,8 +197,10 @@ function twitter_unfollow(App $a, array &$hook_data)
                $connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
                $result = $connection->post('friendships/destroy', ['screen_name' => $contact['nick']]);
                Logger::info('[twitter] API call "friendship/destroy" successful', ['result' => $result]);
+               $hook_data['result'] = true;
        } catch(Exception $e) {
                Logger::notice('[twitter] API call "friendships/destroy" failed', ['uid' => $uid, 'url' => $contact['url'], 'exception' => $e]);
+               $hook_data['result'] = false;
        }
 }