logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: c69b20540958b4de9cc4fd66595d43f26bcd5fd1
parent b2fed59209a92624884df38a477837cba9a8dbd9
Author: Alex Gleason <alex@alexgleason.me>
Date:   Sun, 11 Oct 2020 19:25:34 -0500

Registration: user state is separate from instance state

Diffstat:

Mlib/pleroma/user.ex21+++------------------
1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex @@ -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),