Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
authorsadposter <hannah+pleroma@coffee-and-dreams.uk>
Wed, 25 Sep 2019 12:33:10 +0000 (13:33 +0100)
committersadposter <hannah+pleroma@coffee-and-dreams.uk>
Wed, 25 Sep 2019 12:33:10 +0000 (13:33 +0100)
1  2 
lib/mix/tasks/pleroma/user.ex

index 3f290cf4224969452804dcd98742b508761a1bf6,eb00521440a54b40827507781c248d4d8ce82fd2..974130c6a61786d892151be3949fa2fbccd5759d
@@@ -1,5 -1,5 +1,5 @@@
  # Pleroma: A lightweight social networking server
- # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+ # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
  # SPDX-License-Identifier: AGPL-3.0-only
  
  defmodule Mix.Tasks.Pleroma.User do
      end
    end
  
 +  def run(["change_email", nickname, email]) do
 +    start_pleroma()
 +    with %User{} = user <- User.get_cached_by_nickname(nickname) do
 +       user
 +       |> User.update_changeset(%{"email" => email})
 +       |> User.update_and_set_cache()
 +       shell_info("#{nickname}'s email updated")
 +    end
 +  end
 +
 +  def run(["show", nickname]) do
 +    start_pleroma()
 +    nickname
 +    |> User.get_cached_by_nickname()
 +    |> IO.inspect
 +  end
 +
 +  def run(["send_confirmation", nickname]) do
 +    start_pleroma()
 +    with %User{} = user <- User.get_cached_by_nickname(nickname) do
 +       user
 +       |> Pleroma.Emails.UserEmail.account_confirmation_email()
 +       |> IO.inspect
 +       |> Pleroma.Emails.Mailer.deliver!()
 +       shell_info("#{nickname}'s email sent")
 +    end
 +  end
 +  
 +
    def run(["toggle_confirmed", nickname]) do
      start_pleroma()