aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-06-15 00:30:45 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-07-15 11:39:55 +0200
commit4644a8bd109faf6c684767fc60c37e298b8c5c07 (patch)
treed6ab472116c1ad351d5fda24dca8f44ecd123110 /lib/pleroma/web/mastodon_api
parent10bd08ef07bd91995589ad37cb25e6889dac59b3 (diff)
downloadpleroma-4644a8bd109faf6c684767fc60c37e298b8c5c07.tar.gz
Fix multiple-choice poll detection
Diffstat (limited to 'lib/pleroma/web/mastodon_api')
-rw-r--r--lib/pleroma/web/mastodon_api/views/poll_view.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/poll_view.ex b/lib/pleroma/web/mastodon_api/views/poll_view.ex
index 59a5deb28..73c990e2e 100644
--- a/lib/pleroma/web/mastodon_api/views/poll_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/poll_view.ex
@@ -28,10 +28,10 @@ defmodule Pleroma.Web.MastodonAPI.PollView do
def render("show.json", %{object: object} = params) do
case object.data do
- %{"anyOf" => options} when is_list(options) ->
+ %{"anyOf" => options} when is_list(options) and options != [] ->
render(__MODULE__, "show.json", Map.merge(params, %{multiple: true, options: options}))
- %{"oneOf" => options} when is_list(options) ->
+ %{"oneOf" => options} when is_list(options) and options != [] ->
render(__MODULE__, "show.json", Map.merge(params, %{multiple: false, options: options}))
_ ->