summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-09-22 14:20:19 +0200
committerlain <lain@soykaf.club>2020-09-22 14:20:19 +0200
commitee3052a2d8fda37e27f31c8d824ce7ac174b993c (patch)
tree240c741d5ce5af15942a60c2ed9def2149dba9fa /lib
parentd65e6e152acd772bd75435619a36accfec86555f (diff)
downloadpleroma-ee3052a2d8fda37e27f31c8d824ce7ac174b993c.tar.gz
pleroma-ee3052a2d8fda37e27f31c8d824ce7ac174b993c.zip
ActivityPub: Return Announces when filtering by `following`.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index aacd58d03..eb44cffec 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -790,7 +790,17 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
[activity, object] in query,
where:
fragment(
- "?->>'inReplyTo' is null OR ? && array_remove(?, ?) OR ? = ?",
+ """
+ ?->>'type' != 'Create' -- This isn't a Create
+ OR ?->>'inReplyTo' is null -- this isn't a reply
+ OR ? && array_remove(?, ?) -- The recipient is us or one of our friends,
+ -- unless they are the author (because authors
+ -- are also part of the recipients). This leads
+ -- to a bug that self-replies by friends won't
+ -- show up.
+ OR ? = ? -- The actor is us
+ """,
+ activity.data,
object.data,
^[user.ap_id | User.get_cached_user_friends_ap_ids(user)],
activity.recipients,