Twitter: Fix error after posting #1458

Merged
MrPetovan merged 1 commit from heluecht/friendica-addons:twitter-fix into develop 2024-01-22 15:51:39 +01:00
Showing only changes of commit c28af61873 - Show all commits

View 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]); $response = $client->post($url, ['auth' => 'oauth', $type => $data]);
$body = $response->getBodyString()->getContents(); $body = $response->getBody()->getContents();
$status = [ $status = [
'code' => $response->getStatusCode(), 'code' => $response->getStatusCode(),
@ -399,7 +399,7 @@ function twitter_test_connection(int $uid)
$status = [ $status = [
'code' => $response->getStatusCode(), 'code' => $response->getStatusCode(),
'reason' => $response->getReasonPhrase(), 'reason' => $response->getReasonPhrase(),
'content' => $response->getBodyString()->getContents() 'content' => $response->getBody()->getContents()
]; ];
DI::pConfig()->set(1, 'twitter', 'last_status', $status); DI::pConfig()->set(1, 'twitter', 'last_status', $status);
Logger::info('Test successful', ['uid' => $uid]); Logger::info('Test successful', ['uid' => $uid]);