diff options
author | Ariadne Conill <ariadne@dereferenced.org> | 2019-11-03 09:05:12 -0600 |
---|---|---|
committer | Ariadne Conill <ariadne@dereferenced.org> | 2019-11-03 09:05:12 -0600 |
commit | 4bf942583fdae27813f4af1f901c78eaff391b76 (patch) | |
tree | 5d9377ad245ae1b92dab39d646dcb797b3c7a3d8 /lib | |
parent | 9d8da9ea1501203662e08b6814ac324415653f3e (diff) | |
download | pleroma-4bf942583fdae27813f4af1f901c78eaff391b76.tar.gz |
streamer: use direct object for filter checks when there is no valid child object in an activity
We call Object.normalize/1 to get the child object for situations like Announce.
However, the check is flawed and immediately fails if Object.normalize/1 fails.
Instead, we should use the activity itself in those cases to allow activities which
never have a child object to pass through the filter.
Closes #1291
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/streamer/worker.ex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/streamer/worker.ex b/lib/pleroma/web/streamer/worker.ex index c2ee9e1f5..33b24840d 100644 --- a/lib/pleroma/web/streamer/worker.ex +++ b/lib/pleroma/web/streamer/worker.ex @@ -136,7 +136,7 @@ defmodule Pleroma.Web.Streamer.Worker do recipients = MapSet.new(item.recipients) domain_blocks = Pleroma.Web.ActivityPub.MRF.subdomains_regex(user.domain_blocks) - with parent when not is_nil(parent) <- Object.normalize(item), + with parent <- Object.normalize(item) || item, true <- Enum.all?([blocks, mutes, reblog_mutes], &(item.actor not in &1)), true <- Enum.all?([blocks, mutes], &(parent.data["actor"] not in &1)), true <- MapSet.disjoint?(recipients, recipient_blocks), |