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, Repo}
10 schema "thread_mutes" do
11 belongs_to(:user, User, type: Pleroma.FlakeId)
12 field(:context, :string)
15 def add_mute(user, id) do
16 %{data: %{"context" => context}} = Activity.get_by_id(id)
17 mute = %Pleroma.Web.ThreadMute{user_id: user.id, context: context}
21 def remove_mute(user, id) do