Commit 1377b2e5 authored by lain's avatar lain

Restrict public by recipients.

This is much faster than going through the json. This does break
unlisted, for which we'll probably have to add another table field.
parent a17ba0ee
Pipeline #851 failed with stage
in 2 minutes and 49 seconds
......@@ -155,11 +155,9 @@ def fetch_activities_for_context(context, opts \\ %{}) do
# TODO: Make this work properly with unlisted.
def fetch_public_activities(opts \\ %{}) do
public = %{to: [""]}
q = fetch_activities_query([], opts)
q = from activity in q,
where: fragment(~s(? @> ?),, ^public)
q = fetch_activities_query([""], opts)
|> Repo.all
|> Enum.reverse
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment