X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fuser.ex;h=712bc30478c59c238804dda9450d4226e1c4e592;hb=e3b5559780f798945eea59170afa9ef41bbf59b3;hp=8a54546d6b0ad263cb7fc300ff61bbce94a57111;hpb=8121e46f25b2ea74bdcc635cab20bd17183bcca2;p=akkoma diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 8a54546d6..712bc3047 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -138,6 +138,7 @@ defmodule Pleroma.User do field(:also_known_as, {:array, :string}, default: []) field(:inbox, :string) field(:shared_inbox, :string) + field(:accepts_chat_messages, :boolean, default: nil) embeds_one( :notification_settings, @@ -436,7 +437,8 @@ defmodule Pleroma.User do :discoverable, :invisible, :actor_type, - :also_known_as + :also_known_as, + :accepts_chat_messages ] ) |> validate_required([:name, :ap_id]) @@ -481,7 +483,8 @@ defmodule Pleroma.User do :pleroma_settings_store, :discoverable, :actor_type, - :also_known_as + :also_known_as, + :accepts_chat_messages ] ) |> unique_constraint(:nickname) @@ -623,6 +626,7 @@ defmodule Pleroma.User do def register_changeset(struct, params \\ %{}, opts \\ []) do bio_limit = Pleroma.Config.get([:instance, :user_bio_length], 5000) name_limit = Pleroma.Config.get([:instance, :user_name_length], 100) + params = Map.put_new(params, :accepts_chat_messages, true) need_confirmation? = if is_nil(opts[:need_confirmation]) do @@ -641,7 +645,8 @@ defmodule Pleroma.User do :nickname, :password, :password_confirmation, - :emoji + :emoji, + :accepts_chat_messages ]) |> validate_required([:name, :nickname, :password, :password_confirmation]) |> validate_confirmation(:password)