From adcce820dd231abc4317a34207468dd6d2d25446 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 15 May 2024 08:57:40 +0200 Subject: [PATCH] Fix Pleroma issue --- src/Services/Mastodon_api.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Services/Mastodon_api.php b/src/Services/Mastodon_api.php index d3de647..de8adb9 100644 --- a/src/Services/Mastodon_api.php +++ b/src/Services/Mastodon_api.php @@ -205,7 +205,6 @@ class Mastodon_api foreach ($parameters['headers'] as $key => $value) { $curl->setHeader($key, $value); } - // echo "
",print_r($parameters['body']),"
"; 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);