X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fuser.ex;h=d6628363218f6a0626b367f1f5931fd9f86a3e0c;hb=0f132b802dde7f217ecb07767e0d34e3edb517b7;hp=a9caec55269cd69f864b72b658c25c8b650b4253;hpb=dc9f66749c85352e0d7761ae2b9b8663a3aa3e3a;p=akkoma diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index a9caec552..d66283632 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -145,7 +145,6 @@ defmodule Pleroma.User do field(:also_known_as, {:array, ObjectValidators.ObjectID}, default: []) field(:inbox, :string) field(:shared_inbox, :string) - field(:accepts_chat_messages, :boolean, default: nil) field(:last_active_at, :naive_datetime) field(:disclose_client, :boolean, default: true) field(:pinned_objects, :map, default: %{}) @@ -455,7 +454,6 @@ defmodule Pleroma.User do :invisible, :actor_type, :also_known_as, - :accepts_chat_messages, :pinned_objects ] ) @@ -516,7 +514,6 @@ defmodule Pleroma.User do :pleroma_settings_store, :is_discoverable, :actor_type, - :accepts_chat_messages, :disclose_client ] ) @@ -663,39 +660,10 @@ defmodule Pleroma.User do @spec force_password_reset(User.t()) :: {:ok, User.t()} | {:error, Ecto.Changeset.t()} def force_password_reset(user), do: update_password_reset_pending(user, true) - # Used to auto-register LDAP accounts which won't have a password hash stored locally - def register_changeset_ldap(struct, params = %{password: password}) - when is_nil(password) do - params = Map.put_new(params, :accepts_chat_messages, true) - - params = - if Map.has_key?(params, :email) do - Map.put_new(params, :email, params[:email]) - else - params - end - - struct - |> cast(params, [ - :name, - :nickname, - :email, - :accepts_chat_messages - ]) - |> validate_required([:name, :nickname]) - |> unique_constraint(:nickname) - |> validate_exclusion(:nickname, Config.get([User, :restricted_nicknames])) - |> validate_format(:nickname, local_nickname_regex()) - |> put_ap_id() - |> unique_constraint(:ap_id) - |> put_following_and_follower_and_featured_address() - end - def register_changeset(struct, params \\ %{}, opts \\ []) do bio_limit = Config.get([:instance, :user_bio_length], 5000) name_limit = Config.get([:instance, :user_name_length], 100) reason_limit = Config.get([:instance, :registration_reason_length], 500) - params = Map.put_new(params, :accepts_chat_messages, true) confirmed? = if is_nil(opts[:confirmed]) do @@ -723,7 +691,6 @@ defmodule Pleroma.User do :password, :password_confirmation, :emoji, - :accepts_chat_messages, :registration_reason, :language ]) @@ -826,8 +793,7 @@ defmodule Pleroma.User do {:ok, user} <- set_cache(user), {:ok, _} <- maybe_send_registration_email(user), {:ok, _} <- maybe_send_welcome_email(user), - {:ok, _} <- maybe_send_welcome_message(user), - {:ok, _} <- maybe_send_welcome_chat_message(user) do + {:ok, _} <- maybe_send_welcome_message(user) do {:ok, user} end end @@ -861,15 +827,6 @@ defmodule Pleroma.User do end end - defp maybe_send_welcome_chat_message(user) do - if User.WelcomeChatMessage.enabled?() do - User.WelcomeChatMessage.post_message(user) - {:ok, :enqueued} - else - {:ok, :noop} - end - end - defp maybe_send_welcome_email(%User{email: email} = user) when is_binary(email) do if User.WelcomeEmail.enabled?() do User.WelcomeEmail.send_email(user)