mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
Refactoring
This commit is contained in:
@@ -469,8 +469,12 @@ public class FragmentOAuth extends FragmentBase {
|
||||
|
||||
Log.i("OAuth checking IMAP provider=" + provider.id);
|
||||
String aprotocol = provider.imap.starttls ? "imap" : "imaps";
|
||||
try (EmailService iservice = new EmailService(context, aprotocol, null, false, EmailService.PURPOSE_CHECK, true)) {
|
||||
iservice.connect(provider.imap.host, provider.imap.port, EmailService.AUTH_TYPE_OAUTH, provider.id, primaryEmail, state, null);
|
||||
try (EmailService iservice = new EmailService(
|
||||
context, aprotocol, null, false, EmailService.PURPOSE_CHECK, true)) {
|
||||
iservice.connect(
|
||||
provider.imap.host, provider.imap.port,
|
||||
EmailService.AUTH_TYPE_OAUTH, provider.id,
|
||||
primaryEmail, state, null);
|
||||
|
||||
folders = iservice.getFolders();
|
||||
|
||||
@@ -480,8 +484,12 @@ public class FragmentOAuth extends FragmentBase {
|
||||
|
||||
Log.i("OAuth checking SMTP provider=" + provider.id);
|
||||
String iprotocol = provider.smtp.starttls ? "smtp" : "smtps";
|
||||
try (EmailService iservice = new EmailService(context, iprotocol, null, false, EmailService.PURPOSE_CHECK, true)) {
|
||||
iservice.connect(provider.smtp.host, provider.smtp.port, EmailService.AUTH_TYPE_OAUTH, provider.id, primaryEmail, state, null);
|
||||
try (EmailService iservice = new EmailService(
|
||||
context, iprotocol, null, false, EmailService.PURPOSE_CHECK, true)) {
|
||||
iservice.connect(
|
||||
provider.smtp.host, provider.smtp.port,
|
||||
EmailService.AUTH_TYPE_OAUTH, provider.id,
|
||||
primaryEmail, state, null);
|
||||
}
|
||||
|
||||
Log.i("OAuth passed provider=" + provider.id);
|
||||
|
||||
Reference in New Issue
Block a user