aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-06-22 11:34:07 +0000
committerrinpatch <rinpatch@sdf.org>2020-06-22 11:34:07 +0000
commitc75ba63bef8fe9ac157f59e4552424f02ee00f13 (patch)
tree7b3212f649d3fd2cfd6cd0156120917f45d2a5e9 /lib
parent282f492cd5d039e3139449e186daf3a55e8c680f (diff)
parent7d542450b13742c6efa93246c172c8306e730d50 (diff)
downloadpleroma-c75ba63bef8fe9ac157f59e4552424f02ee00f13.tar.gz
Merge branch '1865-media-only' into 'develop'
Resolve "/api/v1/accounts/:id/statuses?only_media=true returns media that is not owned" Closes #1865 See merge request pleroma/pleroma!2650
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 3e4f3ad30..3e4d0a2be 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -834,7 +834,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
defp restrict_media(query, %{only_media: true}) do
from(
- [_activity, object] in query,
+ [activity, object] in query,
+ where: fragment("(?)->>'type' = ?", activity.data, "Create"),
where: fragment("not (?)->'attachment' = (?)", object.data, ^[])
)
end