forked from AkkomaGang/akkoma
Added thread unmuting (still a bit buggy maybe)
This commit is contained in:
parent
98ec578f4d
commit
5c5b228f21
1 changed files with 6 additions and 5 deletions
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
defmodule Pleroma.Web.ThreadMute do
|
defmodule Pleroma.Web.ThreadMute do
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
|
alias Pleroma.{Activity, Repo, User}
|
||||||
alias Pleroma.{Activity, Notification, User, Repo}
|
require Ecto.Query
|
||||||
|
|
||||||
schema "thread_mutes" do
|
schema "thread_mutes" do
|
||||||
belongs_to(:user, User, type: Pleroma.FlakeId)
|
belongs_to(:user, User, type: Pleroma.FlakeId)
|
||||||
|
@ -19,8 +19,9 @@ def add_mute(user, id) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_mute(user, id) do
|
def remove_mute(user, id) do
|
||||||
end
|
user_id = Pleroma.FlakeId.from_string(user.id)
|
||||||
|
%{data: %{"context" => context}} = Activity.get_by_id(id)
|
||||||
def mute_thread() do
|
Ecto.Query.from(m in "thread_mutes", where: m.user_id == ^user_id and m.context == ^context)
|
||||||
|
|> Repo.delete_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue