mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-22 08:06:55 +00:00
RichMedia: Respect configuration on status previews
This commit is contained in:
parent
05b9805bf9
commit
c16ef40f13
2 changed files with 2 additions and 1 deletions
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 a new issue