Merge branch 'feature/jobs' into 'develop'
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index cd030fe545d665c7116ab4c91fc8afded74bb17b..a49b381c952ed4c8a5e99c91a9c72f00f8f9f0bc 100644 (file)
@@ -5,9 +5,14 @@
 defmodule Pleroma.Web.MastodonAPI.StatusView do
   use Pleroma.Web, :view
 
-  alias Pleroma.{Activity, HTML, Repo, User}
+  alias Pleroma.Activity
+  alias Pleroma.HTML
+  alias Pleroma.Repo
+  alias Pleroma.User
+  alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.CommonAPI.Utils
-  alias Pleroma.Web.MastodonAPI.{AccountView, StatusView}
+  alias Pleroma.Web.MastodonAPI.AccountView
+  alias Pleroma.Web.MastodonAPI.StatusView
   alias Pleroma.Web.MediaProxy
 
   # TODO: Add cached version.
@@ -156,12 +161,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       reblogged: present?(repeated),
       favourited: present?(favorited),
       bookmarked: present?(bookmarked),
-      muted: false,
+      muted: CommonAPI.thread_muted?(user, activity),
       pinned: pinned?(activity, user),
       sensitive: sensitive,
       spoiler_text: object["summary"] || "",
       visibility: get_visibility(object),
-      media_attachments: attachments |> Enum.take(4),
+      media_attachments: attachments,
       mentions: mentions,
       tags: build_tags(tags),
       application: %{