Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/lib/pleroma/web/thread_mute.ex b/lib/pleroma/web/thread_mute.ex
index b37dda58b..a0d564e82 100644
--- a/lib/pleroma/web/thread_mute.ex
+++ b/lib/pleroma/web/thread_mute.ex
@@ -1,26 +1,27 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ThreadMute do
use Ecto.Schema
-
- alias Pleroma.{Activity, Notification, User, Repo}
+ alias Pleroma.{Activity, Repo, User}
+ require Ecto.Query
schema "thread_mutes" do
belongs_to(:user, User, type: Pleroma.FlakeId)
field(:context, :string)
end
def add_mute(user, id) do
%{data: %{"context" => context}} = Activity.get_by_id(id)
mute = %Pleroma.Web.ThreadMute{user_id: user.id, context: context}
Repo.insert(mute)
end
def remove_mute(user, id) do
- end
-
- def mute_thread() do
+ user_id = Pleroma.FlakeId.from_string(user.id)
+ %{data: %{"context" => context}} = Activity.get_by_id(id)
+ Ecto.Query.from(m in "thread_mutes", where: m.user_id == ^user_id and m.context == ^context)
+ |> Repo.delete_all
end
end

File Metadata

Mime Type
text/x-diff
Expires
Sat, Oct 31, 10:34 AM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1801279
Default Alt Text
(1 KB)

Event Timeline