diff options
author | Alex Gleason <alex@alexgleason.me> | 2022-01-24 19:11:14 -0600 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2022-01-24 19:11:14 -0600 |
commit | 1bbc701a3ababc4c6e856ad24f8826da0a0ba1a3 (patch) | |
tree | 202a5600e7c823307b9d73d887053efea02ad0d3 | |
parent | 19d557c870c3ec43dd3b0ee7ea85259a89bd9a80 (diff) | |
download | pleroma-1bbc701a3ababc4c6e856ad24f8826da0a0ba1a3.tar.gz |
ForceMentionsInContent: use `to` instead of `tag`
-rw-r--r-- | lib/pleroma/web/activity_pub/mrf/force_mentions_in_content.ex | 7 |
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} |