summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2024-05-08 17:55:32 +0000
committerfeld <feld@feld.me>2024-05-08 17:55:32 +0000
commit6cfb0d7ddbfca5aef79b6da04e1abb1b1a4b59b7 (patch)
tree4316769df669c5e1e95e01bac3d48c747d36423d /lib
parent8eea4f58c7ae1618aec9f0c6a62e16771c34b787 (diff)
parentccceb41bf3f50ce914c16c2a18ec882e97309214 (diff)
downloadpleroma-6cfb0d7ddbfca5aef79b6da04e1abb1b1a4b59b7.tar.gz
pleroma-6cfb0d7ddbfca5aef79b6da04e1abb1b1a4b59b7.zip
Merge branch 'restore/card-img-alt' into 'develop'
Include image description in status media cards See merge request pleroma/pleroma!4108
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/api_spec/schemas/status.ex4
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex1
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/schemas/status.ex b/lib/pleroma/web/api_spec/schemas/status.ex
index a4052803b..6e537b5da 100644
--- a/lib/pleroma/web/api_spec/schemas/status.ex
+++ b/lib/pleroma/web/api_spec/schemas/status.ex
@@ -58,6 +58,10 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
format: :uri,
description: "Preview thumbnail"
},
+ image_description: %Schema{
+ type: :string,
+ description: "Alternate text that describes what is in the thumbnail"
+ },
title: %Schema{type: :string, description: "Title of linked resource"},
description: %Schema{type: :string, description: "Description of preview"}
}
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index 77af69eef..c945290c1 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -583,6 +583,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
provider_url: page_url_data.scheme <> "://" <> page_url_data.host,
url: page_url,
image: image_url,
+ image_description: rich_media["image:alt"] || "",
title: rich_media["title"] || "",
description: rich_media["description"] || "",
pleroma: %{