aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/activity.ex
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2020-02-25 17:58:15 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2020-02-25 18:08:01 +0300
commit1c05ff7c06e281fe2abd05ff4969e30ec7268bb1 (patch)
treeb7acaaa4b2689cf3c3b956e0a7efd0342bfcc8bc /lib/pleroma/activity.ex
parent42f76306e7fe69fc51be00285a4fef8569f54989 (diff)
downloadpleroma-relay-list-change-for-stable.tar.gz
relay list shows hosts without accepted followrelay-list-change-for-stable
Diffstat (limited to 'lib/pleroma/activity.ex')
-rw-r--r--lib/pleroma/activity.ex7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex
index 2c04a26f9..1967cf868 100644
--- a/lib/pleroma/activity.ex
+++ b/lib/pleroma/activity.ex
@@ -268,6 +268,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)