- # This returns the notification type by activity, but both chats and statuses
- # are in "Create" activities.
- mastodon_type =
- case Activity.mastodon_notification_type(activity) do
- "mention" ->
- object = Object.normalize(activity)
-
- case object do
- %{data: %{"type" => "ChatMessage"}} -> "pleroma:chat_mention"
- _ -> "mention"
- end
-
- type ->
- type
- end
-
- render_opts = %{
- relationships: opts[:relationships],
- skip_relationships: opts[:skip_relationships]
+ # 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})
+
+ response = %{
+ id: to_string(notification.id),
+ type: notification.type,
+ created_at: CommonAPI.Utils.to_masto_date(notification.inserted_at),
+ account: account,
+ pleroma: %{
+ is_muted: User.mutes?(reading_user, actor),
+ is_seen: notification.seen
+ }