Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3500
### Fixed
- MastodonAPI: Stream out Create activities
### Fixed
- MastodonAPI: Stream out Create activities
+- MRF ObjectAgePolicy: Fix pattern matching on "published"
message
|> Map.put("to", to)
|> Map.put("cc", cc)
message
|> Map.put("to", to)
|> Map.put("cc", cc)
+ |> Kernel.put_in(["object", "to"], to)
+ |> Kernel.put_in(["object", "cc"], cc)
message
|> Map.put("to", to)
|> Map.put("cc", cc)
message
|> Map.put("to", to)
|> Map.put("cc", cc)
+ |> Kernel.put_in(["object", "to"], to)
+ |> Kernel.put_in(["object", "cc"], cc)
- def filter(%{"type" => "Create", "published" => _} = message) do
+ def filter(%{"type" => "Create", "object" => %{"published" => _}} = message) do
with actions <- Config.get([:mrf_object_age, :actions]),
{:reject, _} <- check_date(message),
{:ok, message} <- check_reject(message, actions),
with actions <- Config.get([:mrf_object_age, :actions]),
{:reject, _} <- check_date(message),
{:ok, message} <- check_reject(message, actions),
defp get_old_message do
File.read!("test/fixtures/mastodon-post-activity.json")
|> Jason.decode!()
defp get_old_message do
File.read!("test/fixtures/mastodon-post-activity.json")
|> Jason.decode!()
+ |> Map.drop(["published"])
end
defp get_new_message do
end
defp get_new_message do