aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/common_api/common_api.ex9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index c08edbc5f..764fa4f4f 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -467,12 +467,13 @@ defmodule Pleroma.Web.CommonAPI do
{:ok, activity}
end
- def thread_muted?(%{id: nil} = _user, _activity), do: false
-
- def thread_muted?(user, activity) do
- ThreadMute.exists?(user.id, activity.data["context"])
+ def thread_muted?(%User{id: user_id}, %{data: %{"context" => context}})
+ when is_binary("context") do
+ ThreadMute.exists?(user_id, context)
end
+ def thread_muted?(_, _), do: false
+
def report(user, data) do
with {:ok, account} <- get_reported_account(data.account_id),
{:ok, {content_html, _, _}} <- make_report_content_html(data[:comment]),