aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-03-03 21:10:10 +0000
committerkaniini <nenolod@gmail.com>2019-03-03 21:10:10 +0000
commitdd5865535eb16f535ff996eb3dec5e947a905268 (patch)
tree6543397b1d1f12662302128d4f4e8104ae2a9957 /lib
parent8543e7f7608207a7b72987141e9d11263ad52a72 (diff)
parent818a7894da13c10961a411bd2876f74e74494495 (diff)
downloadpleroma-dd5865535eb16f535ff996eb3dec5e947a905268.tar.gz
Merge branch 'muting' into 'develop'
Don't stream muted accounts See merge request pleroma/pleroma!888
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/streamer.ex7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/streamer.ex b/lib/pleroma/web/streamer.ex
index 477481bb9..27e8020f4 100644
--- a/lib/pleroma/web/streamer.ex
+++ b/lib/pleroma/web/streamer.ex
@@ -197,10 +197,12 @@ defmodule Pleroma.Web.Streamer do
if socket.assigns[:user] do
user = User.get_cached_by_ap_id(socket.assigns[:user].ap_id)
blocks = user.info.blocks || []
+ mutes = user.info.mutes || []
parent = Object.normalize(item.data["object"])
- unless is_nil(parent) or item.actor in blocks or parent.data["actor"] in blocks do
+ 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
send(socket.transport_pid, {:text, represent_update(item, user)})
end
else
@@ -224,8 +226,9 @@ defmodule Pleroma.Web.Streamer do
if socket.assigns[:user] do
user = User.get_cached_by_ap_id(socket.assigns[:user].ap_id)
blocks = user.info.blocks || []
+ mutes = user.info.mutes || []
- unless item.actor in blocks do
+ unless item.actor in blocks or item.actor in mutes do
send(socket.transport_pid, {:text, represent_update(item, user)})
end
else