user: properly cope with actors which do not declare a followers collection
authorWilliam Pitcock <nenolod@dereferenced.org>
Tue, 19 Mar 2019 18:23:06 +0000 (18:23 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Tue, 19 Mar 2019 18:23:06 +0000 (18:23 +0000)
lib/pleroma/user.ex

index fb3bd121d1134fbc4cf883a20923a52fcdfc2260..8df276ae0a5843edd84337d3017dc82caa9898b6 100644 (file)
@@ -104,9 +104,8 @@ defmodule Pleroma.User do
     "#{Web.base_url()}/users/#{nickname}"
   end
 
-  def ap_followers(%User{} = user) do
-    "#{ap_id(user)}/followers"
-  end
+  def ap_followers(%User{follower_address: fa}) when is_binary(fa), do: fa
+  def ap_followers(%User{} = user), do: "#{ap_id(user)}/followers"
 
   def user_info(%User{} = user) do
     oneself = if user.local, do: 1, else: 0