Fix messaging [WIP] (#1614)
* Fix messaging [WIP] * Make codeclimate happy * Codeclimate, pls * got it, i hope * Improvements * Remove duplicated checks, other improvements, make login/logout broadcasts * Optimize project imports * Make codeclimate happy again
This commit is contained in:
@@ -35,16 +35,17 @@ public class AsyncChangeEmail implements AsynchronousProcess {
|
||||
|
||||
@Inject
|
||||
private BungeeSender bungeeSender;
|
||||
|
||||
|
||||
@Inject
|
||||
private BukkitService bukkitService;
|
||||
|
||||
AsyncChangeEmail() { }
|
||||
AsyncChangeEmail() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the request to change the player's email address.
|
||||
*
|
||||
* @param player the player to change the email for
|
||||
* @param player the player to change the email for
|
||||
* @param oldEmail provided old email
|
||||
* @param newEmail provided new email
|
||||
*/
|
||||
@@ -70,6 +71,14 @@ public class AsyncChangeEmail implements AsynchronousProcess {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the new email value into the database and informs services.
|
||||
*
|
||||
* @param auth the player auth object
|
||||
* @param player the player object
|
||||
* @param oldEmail the old email value
|
||||
* @param newEmail the new email value
|
||||
*/
|
||||
private void saveNewEmail(PlayerAuth auth, Player player, String oldEmail, String newEmail) {
|
||||
EmailChangedEvent event = bukkitService.createAndCallEvent(isAsync
|
||||
-> new EmailChangedEvent(player, oldEmail, newEmail, isAsync));
|
||||
|
||||
Reference in New Issue
Block a user