From a06d09ab15249d2d8b696c7873c7cf43f3356e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Sat, 27 Sep 2025 10:50:51 +0200 Subject: [PATCH] Update voters count in remote polls when refreshing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- changelog.d/update-poll-voters-count.fix | 1 + lib/pleroma/object/updater.ex | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 changelog.d/update-poll-voters-count.fix diff --git a/changelog.d/update-poll-voters-count.fix b/changelog.d/update-poll-voters-count.fix new file mode 100644 index 000000000..557c2b0df --- /dev/null +++ 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 index b80bc7faf..d7f27184b 100644 --- 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