MastoAPI: Implement all streaming functions.
This commit is contained in:
parent
5719f69ae3
commit
a743940463
7 changed files with 73 additions and 6 deletions
|
|
@ -284,6 +284,17 @@ defmodule Pleroma.User do
|
|||
Repo.all(query)
|
||||
end
|
||||
|
||||
def get_recipients_from_activity(%Activity{data: %{"to" => to}} = activity) do
|
||||
query = from u in User,
|
||||
where: u.local == true
|
||||
|
||||
query = from u in query,
|
||||
where: u.ap_id in ^to,
|
||||
or_where: fragment("? \\\?| ?", u.following, ^to)
|
||||
|
||||
Repo.all(query)
|
||||
end
|
||||
|
||||
def search(query, resolve) do
|
||||
if resolve do
|
||||
User.get_or_fetch_by_nickname(query)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue