X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fthread_mute.ex;h=cc815430a39f576530a3f23d9b6f0ff5cd1accd5;hb=f259b1adab38afd3bea022f831fc74b5584fc755;hp=7353d847609f2a78e029c386c47df3ea4943ef5d;hpb=4c440f12c345eeb1bc5092f9440706b2a220aa38;p=akkoma
diff --git a/lib/pleroma/thread_mute.ex b/lib/pleroma/thread_mute.ex
index 7353d8476..cc815430a 100644
--- a/lib/pleroma/thread_mute.ex
+++ b/lib/pleroma/thread_mute.ex
@@ -1,16 +1,18 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ThreadMute do
use Ecto.Schema
+
alias Pleroma.Repo
- alias Pleroma.User
alias Pleroma.ThreadMute
+ alias Pleroma.User
+
require Ecto.Query
schema "thread_mutes" do
- belongs_to(:user, User, type: Pleroma.FlakeId)
+ belongs_to(:user, User, type: FlakeId.Ecto.CompatType)
field(:context, :string)
end
@@ -22,7 +24,7 @@ defmodule Pleroma.ThreadMute do
end
def query(user_id, context) do
- user_id = Pleroma.FlakeId.from_string(user_id)
+ {:ok, user_id} = FlakeId.Ecto.CompatType.dump(user_id)
ThreadMute
|> Ecto.Query.where(user_id: ^user_id)