marks notifications as read after mute

This commit is contained in:
Maksim Pechnikov 2020-08-28 18:17:44 +03:00
commit f0fefc4f5c
3 changed files with 79 additions and 1 deletions

View 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_as_read(user, activity) do
{:ok, activity}
else
{:error, _} -> {:error, dgettext("errors", "conversation is already muted")}