aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Konou <konoukaren@gmail.com>2019-03-09 16:24:32 +0100
committerKaren Konou <konoukaren@gmail.com>2019-03-15 14:18:53 +0100
commitfe4c1d26fcbe5ce260bde94e75f617ae0fcb338f (patch)
tree546805ab6f003cf100b0303c3e28b8878da1fd84
parent13c298d3543b08e656068a0f50acb35f036bdaaa (diff)
downloadpleroma-fe4c1d26fcbe5ce260bde94e75f617ae0fcb338f.tar.gz
Add ActivityPub.contain_activity checks to streamer
-rw-r--r--lib/pleroma/web/streamer.ex8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pleroma/web/streamer.ex b/lib/pleroma/web/streamer.ex
index 5850a9579..bd91e1f50 100644
--- a/lib/pleroma/web/streamer.ex
+++ b/lib/pleroma/web/streamer.ex
@@ -12,6 +12,7 @@ defmodule Pleroma.Web.Streamer do
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Visibility
alias Pleroma.Web.MastodonAPI.NotificationView
+ alias Pleroma.Web.ActivityPub.ActivityPub
@keepalive_interval :timer.seconds(30)
@@ -203,7 +204,9 @@ defmodule Pleroma.Web.Streamer do
parent = Object.normalize(item.data["object"])
unless is_nil(parent) or item.actor in blocks or item.actor in mutes or
- parent.data["actor"] in blocks or parent.data["actor"] in mutes do
+ not ActivityPub.contain_activity(item, user) or
+ parent.data["actor"] in blocks or
+ parent.data["actor"] in mutes do
send(socket.transport_pid, {:text, represent_update(item, user)})
end
else
@@ -233,7 +236,8 @@ defmodule Pleroma.Web.Streamer do
blocks = user.info.blocks || []
mutes = user.info.mutes || []
- unless item.actor in blocks or item.actor in mutes do
+ unless item.actor in blocks or item.actor in mutes or
+ not ActivityPub.contain_activity(item, user) do
send(socket.transport_pid, {:text, represent_update(item, user)})
end
else