relay list shows hosts without accepted follow

This commit is contained in:
Alexander Strizhakov 2020-02-25 16:21:48 +03:00
commit cc98d010ed
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
8 changed files with 108 additions and 4 deletions

View file

@ -308,6 +308,13 @@ defmodule Pleroma.Activity do
|> where([a], fragment("? ->> 'state' = 'pending'", a.data))
end
def following_requests_for_actor(%Pleroma.User{ap_id: ap_id}) do
Queries.by_type("Follow")
|> where([a], fragment("?->>'state' = 'pending'", a.data))
|> where([a], a.actor == ^ap_id)
|> Repo.all()
end
def restrict_deactivated_users(query) do
deactivated_users =
from(u in User.Query.build(%{deactivated: true}), select: u.ap_id)