Merge branch '1915-dont-filter-announce-notifications' into 'develop'

Streamer: Don't filter out announce notifications.

Closes #1915

See merge request pleroma/pleroma!2719
This commit is contained in:
rinpatch 2020-07-06 09:21:03 +00:00
commit 69f0b286f7
2 changed files with 25 additions and 4 deletions

View file

@ -128,6 +128,23 @@ defmodule Pleroma.Web.StreamerTest do
assert Streamer.filtered_by_user?(user, announce)
end
test "it does stream notifications announces of the user's own posts in the 'user' stream", %{
user: user
} do
Streamer.get_topic_and_add_socket("user", user)
other_user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{status: "hey"})
{:ok, announce} = CommonAPI.repeat(activity.id, other_user)
notification =
Pleroma.Notification
|> Repo.get_by(%{user_id: user.id, activity_id: announce.id})
|> Repo.preload(:activity)
refute Streamer.filtered_by_user?(user, notification)
end
test "it streams boosts of mastodon user in the 'user' stream", %{user: user} do
Streamer.get_topic_and_add_socket("user", user)