Mark notifications about statuses from muted users as read automatically

This commit is contained in:
Sergey Suprunenko 2020-08-15 15:27:41 +02:00
commit 0865f36965
No known key found for this signature in database
GPG key ID: 5DCA7D1BE3914F9C
3 changed files with 12 additions and 2 deletions

View file

@ -217,7 +217,10 @@ defmodule Pleroma.NotificationTest do
muter = Repo.get(User, muter.id)
{:ok, activity} = CommonAPI.post(muted, %{status: "Hi @#{muter.nickname}"})
assert Notification.create_notification(activity, muter)
notification = Notification.create_notification(activity, muter)
assert notification.id
assert notification.seen
end
test "notification created if user is muted without notifications" do
@ -1012,6 +1015,7 @@ defmodule Pleroma.NotificationTest do
[notification] = Notification.for_user(user)
assert notification.activity.object
assert notification.seen
end
test "it doesn't return notifications for muted user with notifications", %{user: user} do