projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix MRF policies to also work with Update
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf
/
no_placeholder_text_policy.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex
b/lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex
index 90272766c4f1d84489f44f20fd5bb59a2a1ecf60..f25bb4efd537e016fba06b835a18e5276bbd0a62 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex
+++ b/
lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex
@@
-6,14
+6,17
@@
defmodule Pleroma.Web.ActivityPub.MRF.NoPlaceholderTextPolicy do
@moduledoc "Ensure no content placeholder is present (such as the dot from mastodon)"
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
@moduledoc "Ensure no content placeholder is present (such as the dot from mastodon)"
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
+ @impl true
+ def history_awareness, do: :auto
+
@impl true
def filter(
%{
@impl true
def filter(
%{
- "type" =>
"Create"
,
+ "type" =>
type
,
"object" => %{"content" => content, "attachment" => _} = _child_object
} = object
)
"object" => %{"content" => content, "attachment" => _} = _child_object
} = object
)
- when content in [".", "<p>.</p>"] do
+ when
type in ["Create", "Update"] and
content in [".", "<p>.</p>"] do
{:ok, put_in(object, ["object", "content"], "")}
end
{:ok, put_in(object, ["object", "content"], "")}
end