Change MRF logic to match when there is an inReplyTo and the public address is in the "to" field

Update the method to alter the to/cc fields for consistency and modify the tests to work without requiring a specific order items in the list
This commit is contained in:
Mark Felder 2025-06-19 14:50:45 -07:00
commit 37d4ed883c
3 changed files with 347 additions and 10 deletions

View file

@ -29,12 +29,11 @@ defmodule Pleroma.Web.ActivityPub.MRF.QuietReply do
} = activity
) do
with true <- is_binary(in_reply_to),
false <- match?([], cc),
true <- Pleroma.Constants.as_public() in to,
%User{follower_address: followers_collection, local: true} <-
User.get_by_ap_id(actor) do
updated_to =
to
|> Kernel.++([followers_collection])
[followers_collection | to]
|> Kernel.--([Pleroma.Constants.as_public()])
updated_cc =