diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index 5d0294d5b..8f844cf87 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -211,14 +211,14 @@ defp log_fetch_error(id, error) do end # if its already an activity, dont wrap - defp prepare_activity_params(%{"object" => _ } = data), do: data + defp prepare_activity_params(%{"object" => _} = data), do: data defp prepare_activity_params(data) do %{ "type" => "Create", # Should we seriously keep this attributedTo thing? "actor" => data["actor"] || data["attributedTo"], - "object" => data, + "object" => data } |> Maps.put_if_present("to", data["to"]) |> Maps.put_if_present("cc", data["cc"]) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 83fde5a65..af8b863f1 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1862,7 +1862,14 @@ def enqueue_outbox_fetches( %{outbox: outbox_address, last_outbox_fetch: last_fetch, local: false} = user ) do with( - last_fetch <- last_fetch.to_unix(), + last_fetch <- + if last_fetch == nil do + 0 + else + last_fetch + |> DateTime.from_iso8601() + |> DateTime.to_unix() + end, now <- DateTime.utc_now().to_unix(), # future => epoch stuff, let it pass # >60 secs in past => ok