Merge branch 'issue/2068' into 'develop'
[akkoma] / lib / pleroma / web / common_api / common_api.ex
index a8141b28f45666bedfcdd7ed10b47bf4ee1aa919..4ab533658e41342571c72d1ee64e2d9650c55908 100644 (file)
@@ -452,7 +452,8 @@ defmodule Pleroma.Web.CommonAPI do
   end
 
   def add_mute(user, activity) do
-    with {:ok, _} <- ThreadMute.add_mute(user.id, activity.data["context"]) do
+    with {:ok, _} <- ThreadMute.add_mute(user.id, activity.data["context"]),
+         _ <- Pleroma.Notification.mark_context_as_read(user, activity.data["context"]) do
       {:ok, activity}
     else
       {:error, _} -> {:error, dgettext("errors", "conversation is already muted")}
@@ -465,7 +466,7 @@ defmodule Pleroma.Web.CommonAPI do
   end
 
   def thread_muted?(%User{id: user_id}, %{data: %{"context" => context}})
-      when is_binary("context") do
+      when is_binary(context) do
     ThreadMute.exists?(user_id, context)
   end