From 51eaece3ea68226f1780e37e46f25e74f3392782 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 11 Oct 2018 10:49:54 +0000 Subject: [PATCH] user: break out local cases for maybe_direct_follow --- lib/pleroma/user.ex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 70726d399..db6f96daa 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -184,7 +184,15 @@ defmodule Pleroma.User do def needs_update?(_), do: true - def maybe_direct_follow(%User{} = follower, %User{info: info} = followed) do + def maybe_direct_follow(%User{} = follower, %User{local: true, info: %{"locked" => true}}) do + {:ok, follower} + end + + def maybe_direct_follow(%User{} = follower, %User{local: true} = followed) do + follow(follower, followed) + end + + def maybe_direct_follow(%User{} = follower, %User{} = followed) do if !User.ap_enabled?(followed) do follow(follower, followed) else -- 2.45.2