end
end
- def maybe_follow(%User{} = follower, %User{info: _info} = followed) do
- if not following?(follower, followed) do
- follow(follower, followed)
- else
- {:ok, follower}
- end
- end
-
@doc "A mass follow for local users. Respects blocks in both directions but does not create activities."
@spec follow_all(User.t(), list(User.t())) :: {atom(), User.t()}
def follow_all(follower, followeds) do
ap_followers = followed.follower_address
cond do
- following?(follower, followed) or info.deactivated ->
- {:error, "Could not follow user: #{followed.nickname} is already on your list."}
+ info.deactivated ->
+ {:error, "Could not follow user: You are deactivated."}
deny_follow_blocked and blocks?(followed, follower) ->
{:error, "Could not follow user: #{followed.nickname} blocked you."}