diff options
| author | lain <lain@soykaf.club> | 2019-02-27 16:46:47 +0100 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2019-02-27 16:46:47 +0100 | 
| commit | c1ae495878cc95d09a051cc56e2bf7dc7ed0a032 (patch) | |
| tree | be4bd948be6a8d0fdac6ba349a35671eae0d6f9d /lib | |
| parent | c4235f96bde49def1fb6927ba79a49a0f75cd60a (diff) | |
| download | pleroma-c1ae495878cc95d09a051cc56e2bf7dc7ed0a032.tar.gz pleroma-c1ae495878cc95d09a051cc56e2bf7dc7ed0a032.zip | |
Add user muted status info to MastodonAPI.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/user.ex | 1 | ||||
| -rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 2 | 
2 files changed, 2 insertions, 1 deletions
| diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 01d532ab3..3a8a51e33 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -960,6 +960,7 @@ defmodule Pleroma.User do      update_and_set_cache(cng)    end +  def mutes?(nil, _), do: false    def mutes?(user, %{ap_id: ap_id}), do: Enum.member?(user.info.mutes, ap_id)    def blocks?(user, %{ap_id: ap_id}) do diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index b90e4252a..3468c0e1c 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -168,7 +168,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do        reblogged: present?(repeated),        favourited: present?(favorited),        bookmarked: present?(bookmarked), -      muted: CommonAPI.thread_muted?(user, activity), +      muted: CommonAPI.thread_muted?(user, activity) || User.mutes?(opts[:for], user),        pinned: pinned?(activity, user),        sensitive: sensitive,        spoiler_text: object["summary"] || "", | 
