RichMedia: Respect configuration on status previews
This commit is contained in:
parent
05b9805bf9
commit
c16ef40f13
0
changelog.d/rich_media_config.skip
Normal file
0
changelog.d/rich_media_config.skip
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user