From fe4c1d26fcbe5ce260bde94e75f617ae0fcb338f Mon Sep 17 00:00:00 2001 From: Karen Konou Date: Sat, 9 Mar 2019 16:24:32 +0100 Subject: [PATCH] Add ActivityPub.contain_activity checks to streamer --- lib/pleroma/web/streamer.ex | 8 ++++++-- 1 file 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 @@ def push_to_socket(topics, topic, %Activity{data: %{"type" => "Announce"}} = ite 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 @@ def push_to_socket(topics, topic, item) 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