Skip LOGIN after XOAUTH2

pull/196/head
M66B 5 years ago
parent b51ec987a0
commit 4c4c7d72cc

@ -858,6 +858,7 @@ public class IMAPStore extends Store
* the mechanism and we have an authenticator for the mechanism, * the mechanism and we have an authenticator for the mechanism,
* and it hasn't been disabled, use it. * and it hasn't been disabled, use it.
*/ */
boolean xoauth2 = false;
ProtocolException pex = null; ProtocolException pex = null;
StringTokenizer st = new StringTokenizer(mechs); StringTokenizer st = new StringTokenizer(mechs);
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {
@ -902,6 +903,7 @@ public class IMAPStore extends Store
return; return;
} }
else if (m.equals("XOAUTH2")) { else if (m.equals("XOAUTH2")) {
xoauth2 = true;
p.authoauth2(user, password); p.authoauth2(user, password);
return; return;
} }
@ -915,7 +917,7 @@ public class IMAPStore extends Store
} }
} }
if (!p.hasCapability("LOGINDISABLED")) if (!p.hasCapability("LOGINDISABLED") && !xoauth2)
try { try {
eu.faircode.email.Log.i("Trying LOGIN"); eu.faircode.email.Log.i("Trying LOGIN");
p.login(user, password); p.login(user, password);

Loading…
Cancel
Save