Handle Fedibird's new quoteUri field
This commit is contained in:
parent
3c8319fe9f
commit
817e308c0d
6 changed files with 92 additions and 10 deletions
|
|
@ -127,6 +127,16 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest
|
|||
assert cng.changes.quoteUrl == "https://misskey.io/notes/8vsn2izjwh"
|
||||
end
|
||||
|
||||
test "Fedibird quote post with quoteUri field" do
|
||||
insert(:user, ap_id: "https://fedibird.com/users/noellabo")
|
||||
|
||||
data = File.read!("test/fixtures/quote_post/fedibird_quote_uri.json") |> Jason.decode!()
|
||||
cng = ArticleNotePageValidator.cast_and_validate(data)
|
||||
|
||||
assert cng.valid?
|
||||
assert cng.changes.quoteUrl == "https://fedibird.com/users/yamako/statuses/107699333438289729"
|
||||
end
|
||||
|
||||
test "Misskey quote post" do
|
||||
insert(:user, ap_id: "https://misskey.io/users/7rkrarq81i")
|
||||
|
||||
|
|
|
|||
|
|
@ -381,12 +381,11 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
|
||||
{:ok, modified} = Transmogrifier.prepare_outgoing(quote_post.data)
|
||||
|
||||
quoted_post = Object.normalize(quoted_post)
|
||||
%{data: %{"id" => quote_id}} = Object.normalize(quoted_post)
|
||||
|
||||
assert modified["object"]["quoteUrl"] == quoted_post.data["id"]
|
||||
|
||||
# Add Misskey's quote as a fallback
|
||||
assert modified["object"]["_misskey_quote"] == quoted_post.data["id"]
|
||||
assert modified["object"]["quoteUrl"] == quote_id
|
||||
assert modified["object"]["quoteUri"] == quote_id
|
||||
assert modified["object"]["_misskey_quote"] == quote_id
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue