diff options
| author | rinpatch <rinpatch@sdf.org> | 2020-10-06 18:11:34 +0000 | 
|---|---|---|
| committer | rinpatch <rinpatch@sdf.org> | 2020-10-06 18:11:34 +0000 | 
| commit | 2698bbc9f63d0bfd59de182d361db03d54aa2a68 (patch) | |
| tree | 6b882c9189ead8228c246c9453ab77ea4fc1128c /lib | |
| parent | 0a69dbc97ccd2c5f1abf4aeb1e4b8fe40cb3bea4 (diff) | |
| parent | ee3052a2d8fda37e27f31c8d824ce7ac174b993c (diff) | |
| download | pleroma-2698bbc9f63d0bfd59de182d361db03d54aa2a68.tar.gz pleroma-2698bbc9f63d0bfd59de182d361db03d54aa2a68.zip  | |
Merge branch 'filtering-following' into 'develop'
ActivityPub: Return Announces when filtering by `following`.
See merge request pleroma/pleroma!3022
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 12 | 
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,  | 
