aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-07-24 11:28:05 +0000
committerlain <lain@soykaf.club>2019-07-24 11:28:05 +0000
commit53fad36b57b61b28db595e445cd01fd6044dab6b (patch)
tree9e8103753ae7e2278e57155119247a57ab44dd9c /lib
parent0be548b90aafda0b524e2ad85e7072961c336023 (diff)
parentf5d574f4ed9aa997a47d03f02adeb701d96f6789 (diff)
downloadpleroma-53fad36b57b61b28db595e445cd01fd6044dab6b.tar.gz
Merge branch 'develop' into 'develop'
Honour domain blocks on streamed notifications/statuses See merge request pleroma/pleroma!1482
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/streamer.ex5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/streamer.ex b/lib/pleroma/web/streamer.ex
index 86e2dc4dd..9ee331030 100644
--- a/lib/pleroma/web/streamer.ex
+++ b/lib/pleroma/web/streamer.ex
@@ -234,10 +234,15 @@ defmodule Pleroma.Web.Streamer do
blocks = user.info.blocks || []
mutes = user.info.mutes || []
reblog_mutes = user.info.muted_reblogs || []
+ domain_blocks = Pleroma.Web.ActivityPub.MRF.subdomains_regex(user.info.domain_blocks)
with parent when not is_nil(parent) <- Object.normalize(item),
true <- Enum.all?([blocks, mutes, reblog_mutes], &(item.actor not in &1)),
true <- Enum.all?([blocks, mutes], &(parent.data["actor"] not in &1)),
+ %{host: item_host} <- URI.parse(item.actor),
+ %{host: parent_host} <- URI.parse(parent.data["actor"]),
+ false <- Pleroma.Web.ActivityPub.MRF.subdomain_match?(domain_blocks, item_host),
+ false <- Pleroma.Web.ActivityPub.MRF.subdomain_match?(domain_blocks, parent_host),
true <- thread_containment(item, user) do
true
else