Merge develop

Merge conflict in lib/pleroma/activity.ex
This commit is contained in:
Alexander Strizhakov 2019-05-08 14:34:36 +00:00 committed by kaniini
commit bfeb33e951
10 changed files with 552 additions and 257 deletions

View file

@ -287,6 +287,29 @@ defmodule Pleroma.Activity do
|> Repo.all()
end
def follow_requests_for_actor(%Pleroma.User{ap_id: ap_id}) do
from(
a in Activity,
where:
fragment(
"? ->> 'type' = 'Follow'",
a.data
),
where:
fragment(
"? ->> 'state' = 'pending'",
a.data
),
where:
fragment(
"coalesce((?)->'object'->>'id', (?)->>'object') = ?",
a.data,
a.data,
^ap_id
)
)
end
@spec query_by_actor(actor()) :: Ecto.Query.t()
def query_by_actor(actor) do
from(a in Activity, where: a.actor == ^actor)