From 076c14b54ef4a0a8c458091ade1239e738fd3905 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 30 Mar 2021 08:48:51 +0200 Subject: [PATCH] Don't auto-approve instance follows Signed-off-by: Thomas Citharel --- lib/federation/activity_pub/types/actors.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/federation/activity_pub/types/actors.ex b/lib/federation/activity_pub/types/actors.ex index e02ddffab..e0ac6d594 100644 --- a/lib/federation/activity_pub/types/actors.ex +++ b/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,