Mastodon API: Add pleroma.thread_muted to Status entity
Needed for pleroma-fe!941
This commit is contained in:
parent
e54694748b
commit
3face45467
4 changed files with 24 additions and 2 deletions
|
|
@ -150,7 +150,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
content: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["content"])},
|
||||
spoiler_text: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["summary"])},
|
||||
expires_at: nil,
|
||||
direct_conversation_id: nil
|
||||
direct_conversation_id: nil,
|
||||
thread_muted: false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -173,6 +174,24 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
assert status.muted == true
|
||||
end
|
||||
|
||||
test "tells if the message is thread muted" do
|
||||
user = insert(:user)
|
||||
other_user = insert(:user)
|
||||
|
||||
{:ok, user} = User.mute(user, other_user)
|
||||
|
||||
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "test"})
|
||||
status = StatusView.render("status.json", %{activity: activity, for: user})
|
||||
|
||||
assert status.pleroma.thread_muted == false
|
||||
|
||||
{:ok, activity} = CommonAPI.add_mute(user, activity)
|
||||
|
||||
status = StatusView.render("status.json", %{activity: activity, for: user})
|
||||
|
||||
assert status.pleroma.thread_muted == true
|
||||
end
|
||||
|
||||
test "tells if the status is bookmarked" do
|
||||
user = insert(:user)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue