|> Repo.one()
end
- @spec mark_as_read(User.t(), Activity.t()) :: {integer(), nil | [term()]}
- def mark_as_read(%User{id: id}, %Activity{data: %{"context" => context}}) do
+ @spec mark_context_as_read(User.t(), String.t()) :: {integer(), nil | [term()]}
+ def mark_context_as_read(%User{id: id}, context) do
from(
n in Notification,
join: a in assoc(n, :activity),
def add_mute(user, activity) do
with {:ok, _} <- ThreadMute.add_mute(user.id, activity.data["context"]),
- _ <- Pleroma.Notification.mark_as_read(user, activity) do
+ _ <- Pleroma.Notification.mark_context_as_read(user, activity.data["context"]) do
{:ok, activity}
else
{:error, _} -> {:error, dgettext("errors", "conversation is already muted")}