@blockbot @_test3 perfect, now agpl compliance @mint
diff --git a/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex b/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex index 01ed179ca..14902de67 100644 --- a/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex @@ -128,10 +128,24 @@ def filter(%{"type" => type} = message) when type in ["Block", "Undo", "Flag", " false <- Enum.member?(Config.get([:mrf_high_roller, :domain_blacklist]), URI.parse(message["actor"]).host), true <- recepient.local, true <- check_cache(message, actor.nickname, recepient.nickname, action) do + tagtarget = case action do + "block" -> Config.get([:mrf_high_roller, :tag_blocked_target]) + "unblock" -> Config.get([:mrf_high_roller, :tag_unblocked_target]) + "report" -> Config.get([:mrf_high_roller, :tag_reported_target]) + "unfollow" -> Config.get([:mrf_high_roller, :tag_unfollowed_target]) + "follow_remove" -> Config.get([:mrf_high_roller, :tag_follow_remove_target]) + "follow_reject" -> Config.get([:mrf_high_roller, :tag_follow_reject_target]) + _ -> true + end + target = if is_nil(tagtarget) or tagtarget do + "@" <> recepient.nickname + else + recepient.nickname <> "@" <> Config.get(Pleroma.Web.Endpoint)[:url][:host] + end replacements = %{ "actor" => tag, - "target" => "@" <> recepient.nickname + "target" => target } msg = @@ -239,6 +253,12 @@ def config_description do "The message to send when someone is blocked; use {actor} and {target} variables", suggestions: ["{target} you have been blocked by {actor}"] }, + %{ + key: :tag_blocked_target, + type: :boolean, + label: "Tag blocked target", + description: "Whether to tag the blocked target or not" + }, %{ key: :tag_blocking_actor, type: :boolean, @@ -260,6 +280,12 @@ def config_description do "The message to send when someone is blocked or unblocked; use {actor} and {target} variables", suggestions: ["{target} you have been unblocked by {actor}"] }, + %{ + key: :tag_unblocked_target, + type: :boolean, + label: "Tag target that got unblocked", + description: "Whether to tag the unblocked target or not" + }, %{ key: :tag_unblocking_actor, type: :boolean, @@ -281,6 +307,12 @@ def config_description do "The message to send when someone is reported; use {actor} and {target} variables", suggestions: ["{target} you have been reported by {actor}"] }, + %{ + key: :tag_reported_target, + type: :boolean, + label: "Tag target that got reported", + description: "Whether to tag the reported target or not" + }, %{ key: :tag_reporting_actor, type: :boolean, @@ -302,6 +334,12 @@ def config_description do "The message to send when someone is unfollowed; use {actor} and {target} variables", suggestions: ["{target} you have been unfollowed by {actor}"] }, + %{ + key: :tag_unfollowed_target, + type: :boolean, + label: "Tag unfollowed target", + description: "Whether to tag the unfollowed target or not" + }, %{ key: :tag_unfollowing_actor, type: :boolean, @@ -323,6 +361,12 @@ def config_description do "The message to send when someone is being removed from followers; use {actor} and {target} variables", suggestions: ["{target} you have been removed from followers by {actor}"] }, + %{ + key: :tag_follow_remove_target, + type: :boolean, + label: "Tag target that was removed as follower", + description: "Whether to tag the target or not" + }, %{ key: :tag_follow_remove_actor, type: :boolean, @@ -344,6 +388,12 @@ def config_description do "The message to send when someone is being rejectd from followers; use {actor} and {target} variables", suggestions: ["{target} your follow request has been rejected by {actor}"] }, + %{ + key: :tag_follow_reject_target, + type: :boolean, + label: "Tag follow rejected target", + description: "Whether to tag the follow rejected target or not" + }, %{ key: :tag_follow_reject_actor, type: :boolean,