aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKaren Konou <konoukaren@gmail.com>2019-02-08 13:17:11 +0100
committerKaren Konou <konoukaren@gmail.com>2019-02-08 13:17:11 +0100
commita44e532fb1be973d6974aa9e357096764252796d (patch)
tree81315f7b2bf54ba5b0064c4bf806b3dee33cfcf1 /lib
parent98ec578f4d36ff1a94ee59087f57704ed109bd9c (diff)
downloadpleroma-a44e532fb1be973d6974aa9e357096764252796d.tar.gz
Added thread unmuting (still a bit buggy maybe)
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/thread_mute.ex11
1 files changed, 6 insertions, 5 deletions
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
@@ -4,8 +4,8 @@
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)
@@ -19,8 +19,9 @@ defmodule Pleroma.Web.ThreadMute do
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