aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-07-11 22:34:50 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-07-11 22:34:50 -0700
commit6fdd43d4fed3554faa63e5e3e3fbb37dd09223b6 (patch)
treee68aae6f1eef9a3711f775d55329990af9a91f2c /src
parent2127eaf90e2a91814aa65d0775e24fabfc73fdb9 (diff)
Improved error code
Diffstat (limited to 'src')
-rw-r--r--src/core/provider/MCAccountValidator.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/core/provider/MCAccountValidator.cpp b/src/core/provider/MCAccountValidator.cpp
index a13dfd99..82b0a5d4 100644
--- a/src/core/provider/MCAccountValidator.cpp
+++ b/src/core/provider/MCAccountValidator.cpp
@@ -382,7 +382,14 @@ void AccountValidator::checkNextHostDone()
ErrorCode error = ErrorNone;
if (mCurrentServiceTested == SERVICE_IMAP) {
- mImapError = ((IMAPOperation *)mOperation)->error();
+ if (mImapError == ErrorAuthentication) {
+ if (((IMAPOperation *)mOperation)->error() != ErrorConnection) {
+ mImapError = ((IMAPOperation *)mOperation)->error();
+ }
+ }
+ else {
+ mImapError = ((IMAPOperation *)mOperation)->error();
+ }
MCLog("checking imap done %i\n", mImapError);
MC_SAFE_REPLACE_COPY(String, mImapLoginResponse, ((IMAPCheckAccountOperation *)mOperation)->loginResponse());
error = mImapError;
@@ -390,14 +397,28 @@ void AccountValidator::checkNextHostDone()
MC_SAFE_RELEASE(mImapSession);
}
else if (mCurrentServiceTested == SERVICE_POP) {
- mPopError = ((POPOperation *)mOperation)->error();
+ if (mPopError == ErrorAuthentication) {
+ if (((POPOperation *)mOperation)->error() != ErrorConnection) {
+ mPopError = ((POPOperation *)mOperation)->error();
+ }
+ }
+ else {
+ mPopError = ((POPOperation *)mOperation)->error();
+ }
MCLog("checking pop done %i\n", mImapError);
error = mPopError;
mPopSession->setConnectionLogger(NULL);
MC_SAFE_RELEASE(mPopSession);
}
else if (mCurrentServiceTested == SERVICE_SMTP) {
- mSmtpError = ((SMTPOperation *)mOperation)->error();
+ if (mSmtpError == ErrorAuthentication) {
+ if (((SMTPOperation *)mOperation)->error() != ErrorConnection) {
+ mSmtpError = ((SMTPOperation *)mOperation)->error();
+ }
+ }
+ else {
+ mSmtpError = ((SMTPOperation *)mOperation)->error();
+ }
MCLog("checking smtp done %i\n", mImapError);
error = mSmtpError;
mSmtpSession->setConnectionLogger(NULL);