#655 Encapsulate mail service

- Change SendMailSSL to be injected into classes and created regardless of settings
- Various minor cleanups (remove accidentally committed test, add more precise logging statement)
This commit is contained in:
ljacqu
2016-07-02 20:56:53 +02:00
parent d2556b8a04
commit 9a5c432509
9 changed files with 80 additions and 72 deletions
@@ -4,6 +4,7 @@ import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.mail.SendMailSSL;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.permission.PermissionsManager;
import fr.xephi.authme.process.AsynchronousProcess;
@@ -55,6 +56,9 @@ public class AsyncRegister implements AsynchronousProcess {
@Inject
private ValidationService validationService;
@Inject
private SendMailSSL sendMailSsl;
AsyncRegister() { }
private boolean preRegisterCheck(Player player, String password) {
@@ -137,7 +141,7 @@ public class AsyncRegister implements AsynchronousProcess {
}
database.updateEmail(auth);
database.updateSession(auth);
plugin.getMail().main(auth, password);
sendMailSsl.sendPasswordMail(auth, password);
syncProcessManager.processSyncEmailRegister(player);
}