From: William Pitcock Date: Thu, 11 Oct 2018 10:49:54 +0000 (+0000) Subject: user: break out local cases for maybe_direct_follow X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=51eaece3ea68226f1780e37e46f25e74f3392782;p=akkoma user: break out local cases for maybe_direct_follow --- 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