logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 1cfc3278c086c9eaa7b2d1bd170e82c8b2aebd78
parent ba3f3a5a56d4a5ac05443fd30b5864778ad1131e
Author: lain <lain@soykaf.club>
Date:   Wed,  4 Nov 2020 10:14:00 +0100

Poll View: Always return `voters_count`.

Diffstat:

Mlib/pleroma/web/mastodon_api/views/poll_view.ex2+-
Mtest/pleroma/web/mastodon_api/views/poll_view_test.exs2+-
2 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 @@ -19,7 +19,7 @@ defmodule Pleroma.Web.MastodonAPI.PollView do expired: expired, multiple: multiple, votes_count: votes_count, - voters_count: (multiple || nil) && voters_count(object), + voters_count: voters_count(object), options: options, voted: voted?(params), emojis: Pleroma.Web.MastodonAPI.StatusView.build_emojis(object.data["emoji"]) diff --git a/test/pleroma/web/mastodon_api/views/poll_view_test.exs b/test/pleroma/web/mastodon_api/views/poll_view_test.exs @@ -44,7 +44,7 @@ defmodule Pleroma.Web.MastodonAPI.PollViewTest do ], voted: false, votes_count: 0, - voters_count: nil + voters_count: 0 } result = PollView.render("show.json", %{object: object})