Parse object link as quoteUrl
This commit is contained in:
parent
163e563733
commit
e9cd004ba1
6 changed files with 65 additions and 0 deletions
17
test/fixtures/quote_post/fep-e232-tag-example.json
vendored
Normal file
17
test/fixtures/quote_post/fep-e232-tag-example.json
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"type": "Note",
|
||||
"content": "This is a quote:<br>RE: https://server.example/objects/123",
|
||||
"tag": [
|
||||
{
|
||||
"type": "Link",
|
||||
"mediaType": "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
|
||||
"href": "https://server.example/objects/123",
|
||||
"name": "RE: https://server.example/objects/123"
|
||||
}
|
||||
],
|
||||
"id": "https://server.example/objects/1",
|
||||
"to": "https://server.example/users/1",
|
||||
"attributedTo": "https://server.example/users/1",
|
||||
"actor": "https://server.example/users/1"
|
||||
}
|
||||
|
|
@ -146,4 +146,16 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest
|
|||
assert cng.valid?
|
||||
assert cng.changes.quoteUrl == "https://misskey.io/notes/8vs6wxufd0"
|
||||
end
|
||||
|
||||
test "Parse tag as quote" do
|
||||
# https://codeberg.org/fediverse/fep/src/branch/main/fep/e232/fep-e232.md
|
||||
|
||||
insert(:user, ap_id: "https://server.example/users/1")
|
||||
|
||||
data = File.read!("test/fixtures/quote_post/fep-e232-tag-example.json") |> Jason.decode!()
|
||||
cng = ArticleNotePageValidator.cast_and_validate(data)
|
||||
|
||||
assert cng.valid?
|
||||
assert cng.changes.quoteUrl == "https://server.example/objects/123"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue