From b7d9aacceee33eaad3104c144493535d73324efa Mon Sep 17 00:00:00 2001 From: Mayel de Borniol Date: Mon, 13 Jan 2025 12:12:55 +0000 Subject: [PATCH] misc --- lib/acts/anti_spam_act.ex | 3 ++- lib/flags.ex | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/acts/anti_spam_act.ex b/lib/acts/anti_spam_act.ex index e605692..ce63416 100644 --- a/lib/acts/anti_spam_act.ex +++ b/lib/acts/anti_spam_act.ex @@ -64,7 +64,8 @@ defmodule Bonfire.Social.Acts.AntiSpam do maybe_apply(Bonfire.Me.Users, :get_or_create_automod, [], fallback_return: nil ) || current_user, - object + object, + skip_federation: true ) do error("could not flag for mods to check") raise Bonfire.Fail, :spam diff --git a/lib/flags.ex b/lib/flags.ex index a598914..3300eb9 100644 --- a/lib/flags.ex +++ b/lib/flags.ex @@ -161,12 +161,13 @@ defmodule Bonfire.Social.Flags do case check_flag(flagger, object, opts) ~> create(flagger, ..., opts) do {:ok, flag} -> - if id(flagger) not in maybe_apply( - Bonfire.Federate.ActivityPub, - :do_not_federate_user_ids, - [], - fallback_return: [] - ) do + if opts[:skip_federation] != true and + id(flagger) not in maybe_apply( + Bonfire.Federate.ActivityPub, + :do_not_federate_user_ids, + [], + fallback_return: [] + ) do Social.maybe_federate_and_gift_wrap_activity(flagger, flag) else {:ok, flag}