Twitter: Fix error after posting
authorMichael <heluecht@pirati.ca>
Sun, 21 Jan 2024 21:24:08 +0000 (21:24 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 21 Jan 2024 21:24:08 +0000 (21:24 +0000)
twitter/twitter.php

index 8c906da..b01345b 100644 (file)
@@ -362,7 +362,7 @@ function twitter_post(int $uid, string $url, string $type, array $data): stdClas
        ]);
 
        $response = $client->post($url, ['auth' => 'oauth', $type => $data]);
-       $body     = $response->getBodyString()->getContents();
+       $body     = $response->getBody()->getContents();
 
        $status = [
                'code'    => $response->getStatusCode(),
@@ -399,7 +399,7 @@ function twitter_test_connection(int $uid)
                $status = [
                        'code'   => $response->getStatusCode(),
                        'reason'  => $response->getReasonPhrase(),
-                       'content' => $response->getBodyString()->getContents()
+                       'content' => $response->getBody()->getContents()
                ];
                DI::pConfig()->set(1, 'twitter', 'last_status',  $status);
                Logger::info('Test successful', ['uid' => $uid]);