Commit cafa1513 authored by lain's avatar lain

Mix format.

parent 4c918392
......@@ -80,8 +80,9 @@ def user_info(%User{} = user) do
@email_regex ~r/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
def remote_user_creation(params) do
params = params
|> Map.put(:info, params[:info] || %{})
params =
params
|> Map.put(:info, params[:info] || %{})
info_cng = User.Info.remote_user_creation(%User.Info{}, params[:info])
......@@ -598,21 +599,25 @@ def blocks?(user, %{ap_id: ap_id}) do
end
def block_domain(user, domain) do
info_cng = user.info
|> User.Info.add_to_domain_block(domain)
info_cng =
user.info
|> User.Info.add_to_domain_block(domain)
cng = change(user)
|> put_embed(:info, info_cng)
cng =
change(user)
|> put_embed(:info, info_cng)
update_and_set_cache(cng)
end
def unblock_domain(user, domain) do
info_cng = user.info
|> User.Info.remove_from_domain_block(domain)
info_cng =
user.info
|> User.Info.remove_from_domain_block(domain)
cng = change(user)
|> put_embed(:info, info_cng)
cng =
change(user)
|> put_embed(:info, info_cng)
update_and_set_cache(cng)
end
......
......@@ -120,11 +120,13 @@ def ensure_keys_present(user) do
else
{:ok, pem} = Salmon.generate_rsa_pem()
info_cng = info
|> Pleroma.User.Info.set_keys(pem)
info_cng =
info
|> Pleroma.User.Info.set_keys(pem)
cng = Ecto.Changeset.change(user)
|> Ecto.Changeset.put_embed(:info, info_cng)
cng =
Ecto.Changeset.change(user)
|> Ecto.Changeset.put_embed(:info, info_cng)
User.update_and_set_cache(cng)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment