user: break out local cases for maybe_direct_follow
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 11 Oct 2018 10:49:54 +0000 (10:49 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 11 Oct 2018 10:49:54 +0000 (10:49 +0000)
lib/pleroma/user.ex

index 70726d399de673d9009a9ffd948d58e1c84d3731..db6f96daa43dbc4f832663b6684de82b8305ede2 100644 (file)
@@ -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