reject: [],
accept: []
+config :pleroma, :rich_media, enabled: true
+
config :pleroma, :media_proxy,
enabled: false,
proxy_opts: [
* Pleroma.Web.Metadata.Providers.TwitterCard
* `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews
+## :rich_media
+* `enabled`: if enabled the instance will parse metadata from attached links to generate link previews
+
## :hackney_pools
Advanced. Tweaks Hackney (http client) connections pools.
alias Pleroma.Web.RichMedia.Parser
def fetch_data_for_activity(%Activity{} = activity) do
- with %Object{} = object <- Object.normalize(activity.data["object"]),
+ with true <- Pleroma.Config.get([:rich_media, :enabled], true),
+ %Object{} = object <- Object.normalize(activity.data["object"]),
{:ok, page_url} <- HTML.extract_first_external_url(object, object.data["content"]),
{:ok, rich_media} <- Parser.parse(page_url) do
%{page_url: page_url, rich_media: rich_media}