ForceMentionsInContent: use `to` instead of `tag`
This commit is contained in:
parent
19d557c870
commit
1bbc701a3a
|
@ -35,15 +35,12 @@ defp extract_mention_uris_from_content(content) do
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@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
|
# image-only posts from pleroma apparently reach this MRF without the content field
|
||||||
content = object["object"]["content"] || ""
|
content = object["object"]["content"] || ""
|
||||||
|
|
||||||
mention_users =
|
mention_users =
|
||||||
tag
|
to
|
||||||
|> Enum.filter(fn tag -> tag["type"] == "Mention" end)
|
|
||||||
|> Enum.map(& &1["href"])
|
|
||||||
|> Enum.reject(&is_nil/1)
|
|
||||||
|> Enum.map(fn ap_id_or_uri ->
|
|> Enum.map(fn ap_id_or_uri ->
|
||||||
case User.get_or_fetch_by_ap_id(ap_id_or_uri) do
|
case User.get_or_fetch_by_ap_id(ap_id_or_uri) do
|
||||||
{:ok, user} -> {ap_id_or_uri, user}
|
{:ok, user} -> {ap_id_or_uri, user}
|
||||||
|
|
Loading…
Reference in New Issue