1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ThreadMute do
8 alias Pleroma.{Activity, Notification, User}
10 schema "thread_mutes" do
11 belongs_to(:user, User, type: Pleroma.FlakeId)
12 field(:context, :string)
15 def add_mute(user, id) do
17 %{data: %{"context" => context}} = Activity.get_by_id(id)
18 Pleroma.Repo.insert(%Pleroma.Web.ThreadMute{user: user_id, context: context})
21 def remove_mute(user, id) do