Fix Pleroma issue

This commit is contained in:
Thomas 2024-05-15 08:57:40 +02:00
parent 7a7c3e6974
commit adcce820dd

View file

@ -205,7 +205,6 @@ class Mastodon_api
foreach ($parameters['headers'] as $key => $value) {
$curl->setHeader($key, $value);
}
// echo "<pre>",print_r($parameters['body']),"</pre>";
if (isset($parameters["method"]) && $parameters['method'] == "POST") {
$response = $curl->post($url, $parameters['body']);
}else if (isset($parameters["method"]) && $parameters['method'] == "GET") {
@ -1276,6 +1275,16 @@ class Mastodon_api
$Polls->setMinExpiration($instantParams['configuration']['polls']['min_expiration']);
$Polls->setMaxExpiration($instantParams['configuration']['polls']['max_expiration']);
}
} else if (isset($instantParams['pleroma'])) {
if (isset($instantParams['poll_limits'])) {
$Polls->setMaxOptions($instantParams['poll_limits']['max_options']);
$Polls->setMaxCharactersPerOption($instantParams['poll_limits']['max_option_chars']);
$Polls->setMinExpiration($instantParams['poll_limits']['min_expiration']);
$Polls->setMaxExpiration($instantParams['poll_limits']['max_expiration']);
}
if(isset($instantParams['max_toot_chars'])) {
$Statuses->setMaxCharacters($instantParams['max_toot_chars']);
}
}
$Configuration->setStatuses($Statuses);
$Configuration->setMediaAttachments($MediaAttachments);