commit: c16ef40f134e69ad509a52dd3470672ca297f084
parent 05b9805bf98ddfc6a0ecf72b778182eb7af169e2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 29 May 2024 07:59:02 +0200
RichMedia: Respect configuration on status previews
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/changelog.d/rich_media_config.skip b/changelog.d/rich_media_config.skip
diff --git a/lib/pleroma/web/rich_media/card.ex b/lib/pleroma/web/rich_media/card.ex
@@ -104,7 +104,8 @@ defmodule Pleroma.Web.RichMedia.Card do
@spec get_by_activity(Activity.t()) :: t() | nil | :error
# Fake/Draft activity
def get_by_activity(%Activity{id: "pleroma:fakeid"} = activity) do
- with %Object{} = object <- Object.normalize(activity, fetch: false),
+ with {_, true} <- {:config, @config_impl.get([:rich_media, :enabled])},
+ %Object{} = object <- Object.normalize(activity, fetch: false),
url when not is_nil(url) <- HTML.extract_first_external_url_from_object(object) do
case get_by_url(url) do
# Cache hit