Permit backdating the poll closed timestamp

This commit is contained in:
Mark Felder 2024-09-30 14:45:13 -04:00
parent 766edfe5b2
commit b2340b5b77

View file

@ -241,6 +241,7 @@ def tombstone_factory do
def question_factory(attrs \\ %{}) do
user = attrs[:user] || insert(:user)
closed = attrs[:closed] || DateTime.utc_now() |> DateTime.add(86_400) |> DateTime.to_iso8601()
data = %{
"id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
@ -251,7 +252,7 @@ def question_factory(attrs \\ %{}) do
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
"cc" => [user.follower_address],
"context" => Pleroma.Web.ActivityPub.Utils.generate_context_id(),
"closed" => DateTime.utc_now() |> DateTime.add(86_400) |> DateTime.to_iso8601(),
"closed" => closed,
"content" => "Which flavor of ice cream do you prefer?",
"oneOf" => [
%{