diff options
author | Hélène <pleroma-dev@helene.moe> | 2022-08-07 20:39:35 +0200 |
---|---|---|
committer | Hélène <pleroma-dev@helene.moe> | 2022-08-10 02:29:38 +0200 |
commit | def0f5dc2e76b7c4ac22b393abf7f5de5e197659 (patch) | |
tree | f09c7918f59e1f9d40ba137b1577fab4ce98483c /lib | |
parent | a9111bcaf2ba2371a1021dc171dab50615a4c040 (diff) | |
download | pleroma-def0f5dc2e76b7c4ac22b393abf7f5de5e197659.tar.gz pleroma-def0f5dc2e76b7c4ac22b393abf7f5de5e197659.zip |
StatusView: implement pleroma.context field
This field replaces the now deprecated conversation_id field, and now
exposes the ActivityPub object `context` directly via the MastoAPI
instead of relying on StatusNet-era data concepts.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/api_spec/schemas/status.ex | 9 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/pleroma/web/api_spec/schemas/status.ex b/lib/pleroma/web/api_spec/schemas/status.ex index 6e6e30315..8c19a9d9f 100644 --- a/lib/pleroma/web/api_spec/schemas/status.ex +++ b/lib/pleroma/web/api_spec/schemas/status.ex @@ -142,9 +142,15 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do description: "A map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`" }, + context: %Schema{ + type: :string, + description: "The thread identifier the status is associated with" + }, conversation_id: %Schema{ type: :integer, - description: "The ID of the AP context the status is associated with (if any)" + deprecated: true, + description: + "The ID of the AP context the status is associated with (if any); deprecated, please use `context` instead" }, direct_conversation_id: %Schema{ type: :integer, @@ -319,6 +325,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do "pinned" => false, "pleroma" => %{ "content" => %{"text/plain" => "foobar"}, + "context" => "http://localhost:4001/objects/8b4c0c80-6a37-4d2a-b1b9-05a19e3875aa", "conversation_id" => 345_972, "direct_conversation_id" => nil, "emoji_reactions" => [], diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 5cb524f56..a4d6cd807 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -375,6 +375,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do pleroma: %{ local: activity.local, conversation_id: get_context_id(activity), + context: object.data["context"], in_reply_to_account_acct: reply_to_user && reply_to_user.nickname, content: %{"text/plain" => content_plaintext}, spoiler_text: %{"text/plain" => summary}, |