Browse Source

Don't auto-approve instance follows

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
chapril^2
Thomas Citharel 2 weeks ago
parent
commit
076c14b54e
No known key found for this signature in database GPG Key ID: A061B9DDE0CA0773
  1. 7
      lib/federation/activity_pub/types/actors.ex

7
lib/federation/activity_pub/types/actors.ex

@ -3,7 +3,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Actors do
alias Mobilizon.Actors
alias Mobilizon.Actors.{Actor, Follower, Member}
alias Mobilizon.Federation.ActivityPub
alias Mobilizon.Federation.ActivityPub.Audience
alias Mobilizon.Federation.ActivityPub.{Audience, Relay}
alias Mobilizon.Federation.ActivityPub.Types.Entity
alias Mobilizon.Federation.ActivityStream.Convertible
alias Mobilizon.GraphQL.API.Utils, as: APIUtils
@ -223,7 +223,10 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Actors do
%Follower{} = follower,
follow_as_data
) do
unless follower.target_actor.manually_approves_followers do
%Actor{id: relay_id} = Relay.get_actor()
unless follower.target_actor.manually_approves_followers or
follower.target_actor.id == relay_id do
{:accept,
ActivityPub.accept(
:follow,

Loading…
Cancel
Save