Registration: user state is separate from instance state
authorAlex Gleason <alex@alexgleason.me>
Mon, 12 Oct 2020 00:25:34 +0000 (19:25 -0500)
committerAlex Gleason <alex@alexgleason.me>
Mon, 12 Oct 2020 00:25:34 +0000 (19:25 -0500)
lib/pleroma/user.ex

index 3f40ac9b39ce0265589cf3e6fde9cf9db2d05cbe..3a4f031b1d08d9425a004412acf596f3b14ec178 100644 (file)
@@ -772,33 +772,18 @@ defmodule Pleroma.User do
     end
   end
 
-  def post_register_action(%User{} = user) do
-    instance_config =
-      Config.get(:instance)
-      |> Enum.into(%{})
-
-    do_post_register_action(user, instance_config)
-  end
-
-  defp do_post_register_action(%User{confirmation_pending: true} = user, %{
-         account_activation_required: true
-       }) do
+  def post_register_action(%User{confirmation_pending: true} = user) do
     with {:ok, _} <- try_send_confirmation_email(user) do
       {:ok, user}
     end
   end
 
-  defp do_post_register_action(%User{approval_pending: true} = user, %{
-         account_approval_required: true
-       }) do
+  def post_register_action(%User{approval_pending: true} = user) do
     # TODO: Send approval explanation email
     {:ok, user}
   end
 
-  defp do_post_register_action(
-         %User{approval_pending: false, confirmation_pending: false} = user,
-         _instance_config
-       ) do
+  def post_register_action(%User{approval_pending: false, confirmation_pending: false} = user) do
     with {:ok, user} <- autofollow_users(user),
          {:ok, user} <- set_cache(user),
          {:ok, _} <- send_welcome_email(user),