aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-02-26 10:09:30 +0100
committerlain <lain@soykaf.club>2018-02-26 10:09:30 +0100
commit1377b2e569e91b4f51ba4715b343e1a8a7feb8ba (patch)
tree41ebd6e06809f4cc97082028aad00ad68dfdff07 /lib
parenta17ba0ee0df07c0ce12dd8773a974c45a1e539a4 (diff)
downloadpleroma-1377b2e569e91b4f51ba4715b343e1a8a7feb8ba.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 667f8fc15..965f2cc9b 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -155,11 +155,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
Repo.all(query)
end
+ # TODO: Make this work properly with unlisted.
def fetch_public_activities(opts \\ %{}) do
- public = %{to: ["https://www.w3.org/ns/activitystreams#Public"]}
- q = fetch_activities_query([], opts)
- q = from activity in q,
- where: fragment(~s(? @> ?), activity.data, ^public)
+ q = fetch_activities_query(["https://www.w3.org/ns/activitystreams#Public"], opts)
q
|> Repo.all
|> Enum.reverse