Add field to user schema for controlling disclosure of client details
authorMark Felder <feld@feld.me>
Thu, 18 Feb 2021 22:43:41 +0000 (16:43 -0600)
committerMark Felder <feld@feld.me>
Thu, 18 Feb 2021 22:43:41 +0000 (16:43 -0600)
lib/pleroma/user.ex
priv/repo/migrations/20210218223811_add_disclose_client_to_users.exs [new file with mode: 0644]

index 51f5bc8ea1a5dd3c404cae92f9709e59d6ec6371..a52089d7bccebdc6e5090c2649cec12738d0e471 100644 (file)
@@ -147,6 +147,7 @@ defmodule Pleroma.User do
     field(:shared_inbox, :string)
     field(:accepts_chat_messages, :boolean, default: nil)
     field(:last_active_at, :naive_datetime)
+    field(:disclose_client, :boolean, default: true)
 
     embeds_one(
       :notification_settings,
diff --git a/priv/repo/migrations/20210218223811_add_disclose_client_to_users.exs b/priv/repo/migrations/20210218223811_add_disclose_client_to_users.exs
new file mode 100644 (file)
index 0000000..c6b6fe7
--- /dev/null
@@ -0,0 +1,15 @@
+defmodule Pleroma.Repo.Migrations.AddDiscloseClientToUsers do
+  use Ecto.Migration
+
+  def up do
+    alter table(:users) do
+      add(:disclose_client, :boolean, default: true)
+    end
+  end
+
+  def down do
+    alter table(:users) do
+      remove(:disclose_client)
+    end
+  end
+end