Merge branch 'fix/mrf-simple-welcome-chats' into 'develop'
Ensure we only apply media_nsfw simple policy on parsable objects Closes #2133 See merge request pleroma/pleroma!2992
This commit is contained in:
parent
bb70b231d0
commit
0465bdbd49
3 changed files with 42 additions and 2 deletions
|
|
@ -66,7 +66,8 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicy do
|
|||
"type" => "Create",
|
||||
"object" => child_object
|
||||
} = object
|
||||
) do
|
||||
)
|
||||
when is_map(child_object) do
|
||||
media_nsfw =
|
||||
Config.get([:mrf_simple, :media_nsfw])
|
||||
|> MRF.subdomains_regex()
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
def fix_emoji(%{"tag" => tags} = object) when is_list(tags) do
|
||||
emoji =
|
||||
tags
|
||||
|> Enum.filter(fn data -> data["type"] == "Emoji" and data["icon"] end)
|
||||
|> Enum.filter(fn data -> is_map(data) and data["type"] == "Emoji" and data["icon"] end)
|
||||
|> Enum.reduce(%{}, fn data, mapping ->
|
||||
name = String.trim(data["name"], ":")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue