InlineQuotePolicy: skip objects which already have an .inline-quote span

This commit is contained in:
Alex Gleason 2022-01-30 10:57:29 -06:00 committed by tusooa
commit f9697e68c2
No known key found for this signature in database
GPG key ID: 42AEC43D48433C51
3 changed files with 83 additions and 1 deletions

View file

@ -72,4 +72,21 @@ defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicyTest do
{:ok, filtered} = InlineQuotePolicy.filter(activity)
assert filtered == activity
end
test "skips objects which already have an .inline-quote span" do
object =
File.read!("test/fixtures/quote_post/fedibird_quote_mismatched.json") |> Jason.decode!()
# Normally the ObjectValidator will fix this before it reaches MRF
object = Map.put(object, "quoteUrl", object["quoteUri"])
activity = %{
"type" => "Create",
"actor" => "https://fedibird.com/users/noellabo",
"object" => object
}
{:ok, filtered} = InlineQuotePolicy.filter(activity)
assert filtered == activity
end
end