commit: aaaf18c1c52a6dbba708699046e61562f59bbaed
parent dccb264c42632533328b0b64ebb5c12f709931c0
Author: mkljczk <me@mkljczk.pl>
Date: Sat, 27 Sep 2025 12:49:46 +0200
Merge branch 'update-poll-voters-count' into 'develop'
Update voters count in remote polls when refreshing
See merge request pleroma/pleroma!4366
Diffstat:
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/changelog.d/update-poll-voters-count.fix b/changelog.d/update-poll-voters-count.fix
@@ -0,0 +1 @@
+Update voters count in remote polls when refreshing
diff --git a/lib/pleroma/object/updater.ex b/lib/pleroma/object/updater.ex
@@ -5,6 +5,7 @@
defmodule Pleroma.Object.Updater do
require Pleroma.Constants
+ alias Pleroma.Maps
alias Pleroma.Object
alias Pleroma.Repo
@@ -115,6 +116,7 @@ defmodule Pleroma.Object.Updater do
# Choices are the same, but counts are different
to_be_updated
|> Map.put(key, updated_object[key])
+ |> Maps.put_if_present("votersCount", updated_object["votersCount"])
else
# Choices (or vote type) have changed, do not allow this
_ -> to_be_updated