diff options
author | kaniini <ariadne@dereferenced.org> | 2019-08-10 18:29:16 +0000 |
---|---|---|
committer | kaniini <ariadne@dereferenced.org> | 2019-08-10 18:29:16 +0000 |
commit | 390329a303dd6d6a91d0bafa7dff0f7d63a8dad5 (patch) | |
tree | 75d2bc4a55e1469d60bb770288652c962eaa4449 | |
parent | 337edb3e500dc8d3d74926eb9da739bec8e8a7ac (diff) | |
parent | 0802a08871afee7f09362cbca8b802f0e27ff4b9 (diff) | |
download | pleroma-390329a303dd6d6a91d0bafa7dff0f7d63a8dad5.tar.gz |
Merge branch 'fix/mastoapi-threadmute-detection' into 'develop'
Mastodon API: Fix thread mute detection
See merge request pleroma/pleroma!1548
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 2 | ||||
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index dccc36965..31caef499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Federation/MediaProxy not working with instances that have wrong certificate order - Mastodon API: Handling of search timeouts (`/api/v1/search` and `/api/v2/search`) - Mastodon API: Embedded relationships not being properly rendered in the Account entity of Status entity +- Mastodon API: `muted` in the Status entity, using author's account to determine if the tread was muted - Mastodon API: Add `account_id`, `type`, `offset`, and `limit` to search API (`/api/v1/search` and `/api/v2/search`) - Mastodon API, streaming: Fix filtering of notifications based on blocks/mutes/thread mutes - ActivityPub C2S: follower/following collection pages being inaccessible even when authentifucated if `hide_followers`/ `hide_follows` was set diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 80df9b2ac..02819e116 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 thread_muted? = case activity.thread_muted? do thread_muted? when is_boolean(thread_muted?) -> thread_muted? - nil -> CommonAPI.thread_muted?(user, activity) + nil -> (opts[:for] && CommonAPI.thread_muted?(opts[:for], activity)) || false end attachment_data = object.data["attachment"] || [] diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index e49c4cc22..b023d1e4f 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -2901,8 +2901,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do describe "conversation muting" do setup do + post_user = insert(:user) user = insert(:user) - {:ok, activity} = CommonAPI.post(user, %{"status" => "HIE"}) + + {:ok, activity} = CommonAPI.post(post_user, %{"status" => "HIE"}) [user: user, activity: activity] end |