From: Hypolite Petovan Date: Sat, 2 Oct 2021 15:27:57 +0000 (-0400) Subject: [twitter] Fix typo, improve formatting in twitter_unfollow() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=31dd9f8e22dec96813e9d62f4e0525e40079948b;p=friendica-addons.git [twitter] Fix typo, improve formatting in twitter_unfollow() --- diff --git a/twitter/twitter.php b/twitter/twitter.php index f8da6cc4..02470f98 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -177,15 +177,15 @@ function twitter_follow(App $a, array &$contact) function twitter_unfollow(App $a, array &$hook_data) { $contact = $hook_data['contact']; - if ($contact['netword'] !== Protocol::TWITTER) { + if ($contact['network'] !== Protocol::TWITTER) { return; } $uid = $a->getLoggedInUserId(); - $ckey = DI::config()->get('twitter', 'consumerkey'); + $ckey = DI::config()->get('twitter', 'consumerkey'); $csecret = DI::config()->get('twitter', 'consumersecret'); - $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken'); + $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken'); $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret'); // If the addon is not configured (general or for this user) quit here @@ -195,10 +195,10 @@ function twitter_unfollow(App $a, array &$hook_data) try { $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]); $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]); $hook_data['result'] = false; }