feat(api): add the Mastodon quote entity to statuses

Mastodon 4.4+ clients read quotes from a top-level quote object with
state and quoted_status; Pleroma only had pleroma.quote, so they did
not show quote posts. Quoted statuses get a shallow quote with only
quoted_status_id, as quotes are rendered one level deep.

Inspired by Akkoma 5b7209980, which can not use the shallow form because
Akkoma already had a top-level quote status.
This commit is contained in:
Lain Soykaf 2026-10-28 11:38:49 +04:00
commit 3890fbc127
No known key found for this signature in database
4 changed files with 107 additions and 2 deletions

View file

@ -234,6 +234,29 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
type: :integer,
description: "How many statuses quoted this status."
},
quote: %Schema{
type: :object,
nullable: true,
description:
"The status being quoted, if any (Mastodon 4.4+). Quoted statuses only have `quoted_status_id`.",
properties: %{
state: %Schema{
type: :string,
enum: ["accepted", "unauthorized", "deleted"],
description: "Whether the quoted status can be shown"
},
quoted_status: %Schema{
allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
nullable: true,
description: "The quoted status, if it can be shown"
},
quoted_status_id: %Schema{
type: :string,
nullable: true,
description: "ID of the quoted status, if it can be shown"
}
}
},
reblog: %Schema{
allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
nullable: true,