|> where([r], r.state == ^:follow_accept)
end
+ def outgoing_pending_follow_requests_query(%User{} = follower) do
+ __MODULE__
+ |> where([r], r.follower_id == ^follower.id)
+ |> where([r], r.state == ^:follow_pending)
+ end
+
def following(%User{} = user) do
following =
following_query(user)
delete_user_activities(user)
+ delete_outgoing_pending_follow_requests(user)
+
delete_or_deactivate(user)
end
defp delete_activity(_activity, _user), do: "Doing nothing"
+ defp delete_outgoing_pending_follow_requests(user) do
+ user
+ |> FollowingRelationship.outgoing_pending_follow_requests_query()
+ |> Repo.delete_all()
+ end
+
def html_filter_policy(%User{no_rich_text: true}) do
Pleroma.HTML.Scrubber.TwitterText
end
follower = insert(:user)
{:ok, follower} = User.follow(follower, user)
+ locked_user = insert(:user, name: "locked", locked: true)
+ {:ok, _} = User.follow(user, locked_user, :follow_pending)
+
object = insert(:note, user: user)
activity = insert(:note_activity, user: user, note: object)
refute User.following?(follower, user)
assert %{deactivated: true} = User.get_by_id(user.id)
+ assert [] == User.get_follow_requests(locked_user)
+
user_activities =
user.ap_id
|> Activity.Queries.by_actor()