summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pleroma/web/activity_pub/mrf/force_mentions_in_content.ex7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/pleroma/web/activity_pub/mrf/force_mentions_in_content.ex b/lib/pleroma/web/activity_pub/mrf/force_mentions_in_content.ex
index 522ae2f60..8d3885d7b 100644
--- a/lib/pleroma/web/activity_pub/mrf/force_mentions_in_content.ex
+++ b/lib/pleroma/web/activity_pub/mrf/force_mentions_in_content.ex
@@ -35,15 +35,12 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContent do
end
@impl true
- def filter(%{"type" => "Create", "object" => %{"type" => "Note", "tag" => tag}} = object) do
+ def filter(%{"type" => "Create", "object" => %{"type" => "Note", "to" => to}} = object) do
# image-only posts from pleroma apparently reach this MRF without the content field
content = object["object"]["content"] || ""
mention_users =
- tag
- |> Enum.filter(fn tag -> tag["type"] == "Mention" end)
- |> Enum.map(& &1["href"])
- |> Enum.reject(&is_nil/1)
+ to
|> Enum.map(fn ap_id_or_uri ->
case User.get_or_fetch_by_ap_id(ap_id_or_uri) do
{:ok, user} -> {ap_id_or_uri, user}