aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-04-07 16:40:03 +0200
committerlain <lain@soykaf.club>2018-04-07 16:40:45 +0200
commit70bcdf32bdf98c02d9f44c07cbcf74d4c59ed299 (patch)
tree9095036ae6cb0ef8c468e47bf3091aa5facbc996 /lib
parenta9203ab363fdedcf69c3f299063345e26b836a05 (diff)
downloadpleroma-70bcdf32bdf98c02d9f44c07cbcf74d4c59ed299.tar.gz
Only search in public data for now.
This should be the data the user is allowed to see later, but this will stop accidental private message leaks.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex1
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api.ex1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index ccba4710a..6339704a2 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -507,6 +507,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
from(
a in Activity,
where: fragment("?->>'type' = 'Create'", a.data),
+ where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients,
where:
fragment(
"to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)",
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex
index 027b97154..c12cd7f8a 100644
--- a/lib/pleroma/web/twitter_api/twitter_api.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api.ex
@@ -193,6 +193,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
from(
a in Activity,
where: fragment("?->>'type' = 'Create'", a.data),
+ where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients,
where:
fragment(
"to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)",