aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-07-02 10:08:42 +0000
committerrinpatch <rinpatch@sdf.org>2020-07-02 10:08:42 +0000
commitb0439df1b529301c8f07097bedb1cba2602a4143 (patch)
treee3085f3ecfa1e564194e99454618f3af46e03d8f /lib
parentd884b6f704b3d6e5f4b09349224a0c498b75a09b (diff)
parentbad08f34caf0f037b5d6e724628a222fe65b751b (diff)
downloadpleroma-b0439df1b529301c8f07097bedb1cba2602a4143.tar.gz
Merge branch '1907-fix-announce-streaming' into 'develop'
Resolve "Streaming API: Repeats of your posts from random people are pushed to the timeline" Closes #1907 See merge request pleroma/pleroma!2714
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/side_effects.ex6
-rw-r--r--lib/pleroma/web/streamer/streamer.ex1
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex
index 5cc2eb378..61feeae4d 100644
--- a/lib/pleroma/web/activity_pub/side_effects.ex
+++ b/lib/pleroma/web/activity_pub/side_effects.ex
@@ -6,6 +6,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
collection, and so on.
"""
alias Pleroma.Activity
+ alias Pleroma.Activity.Ir.Topics
alias Pleroma.Chat
alias Pleroma.Chat.MessageReference
alias Pleroma.Notification
@@ -97,7 +98,10 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
if !User.is_internal_user?(user) do
Notification.create_notifications(object)
- ActivityPub.stream_out(object)
+
+ object
+ |> Topics.get_activity_topics()
+ |> Streamer.stream(object)
end
{:ok, object, meta}
diff --git a/lib/pleroma/web/streamer/streamer.ex b/lib/pleroma/web/streamer/streamer.ex
index d1d2c9b9c..73ee3e1e1 100644
--- a/lib/pleroma/web/streamer/streamer.ex
+++ b/lib/pleroma/web/streamer/streamer.ex
@@ -116,6 +116,7 @@ defmodule Pleroma.Web.Streamer do
true <-
Enum.all?([blocked_ap_ids, muted_ap_ids], &(item.actor not in &1)),
true <- item.data["type"] != "Announce" || item.actor not in reblog_muted_ap_ids,
+ true <- !(item.data["type"] == "Announce" && parent.data["actor"] == user.ap_id),
true <- Enum.all?([blocked_ap_ids, muted_ap_ids], &(parent.data["actor"] not in &1)),
true <- MapSet.disjoint?(recipients, recipient_blocks),
%{host: item_host} <- URI.parse(item.actor),