Add is_muted to notifications

This commit is contained in:
Egor Kislitsyn 2020-06-22 19:03:04 +04:00
commit 7e6f43c0d7
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
2 changed files with 31 additions and 13 deletions

View file

@ -84,12 +84,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
# Note: :relationships contain user mutes (needed for :muted flag in :status)
status_render_opts = %{relationships: opts[:relationships]}
account =
AccountView.render(
"show.json",
%{user: actor, for: reading_user}
)
account = AccountView.render("show.json", %{user: actor, for: reading_user})
response = %{
id: to_string(notification.id),
@ -97,6 +92,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
created_at: CommonAPI.Utils.to_masto_date(notification.inserted_at),
account: account,
pleroma: %{
is_muted: User.mutes?(reading_user, actor),
is_seen: notification.seen
}
}