From 2a07d182fff49f453f845298101bea7531da40f2 Mon Sep 17 00:00:00 2001 From: Dmitry Isaikin Date: Mon, 19 Sep 2016 08:56:03 +0400 Subject: Enable workaround for QIP IMAP server (#1512) --- src/core/imap/MCIMAPSession.cpp | 13 +++++++++++++ src/core/imap/MCIMAPSession.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index 5bbdf379..4cfcfa95 100644 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -397,6 +397,7 @@ void IMAPSession::init() mYahooServer = false; mRamblerRuServer = false; mHermesServer = false; + mQipServer = false; mLastFetchedSequenceNumber = 0; mCurrentFolder = NULL; pthread_mutex_init(&mIdleLock, NULL); @@ -717,6 +718,7 @@ void IMAPSession::connect(ErrorCode * pError) } mRamblerRuServer = (mHostname->locationOfString(MCSTR(".rambler.ru")) != -1); mHermesServer = (mWelcomeString->locationOfString(MCSTR("Hermes")) != -1); + mQipServer = (mWelcomeString->locationOfString(MCSTR("QIP IMAP server")) != -1); } mState = STATE_CONNECTED; @@ -3921,6 +3923,13 @@ void IMAPSession::storeFlagsAndCustomFlags(String * folder, bool identifier_is_u store_att_flags = mailimap_store_att_flags_new_set_flags_silent(flag_list); break; } + +#ifdef LIBETPAN_HAS_MAILIMAP_QIP_WORKAROUND + if (mQipServer) { + mailimap_set_qip_workaround_enabled(mImap, 1); + } +#endif + if (identifier_is_uid) { r = mailimap_uid_store(mImap, current_set, store_att_flags); } @@ -3928,6 +3937,10 @@ void IMAPSession::storeFlagsAndCustomFlags(String * folder, bool identifier_is_u r = mailimap_store(mImap, current_set, store_att_flags); } +#ifdef LIBETPAN_HAS_MAILIMAP_QIP_WORKAROUND + mailimap_set_qip_workaround_enabled(mImap, 0); +#endif + if (r == MAILIMAP_ERROR_STREAM) { mShouldDisconnect = true; * pError = ErrorConnection; diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h index 0fb93c42..59623537 100644 --- a/src/core/imap/MCIMAPSession.h +++ b/src/core/imap/MCIMAPSession.h @@ -272,6 +272,7 @@ namespace mailcore { bool mYahooServer; bool mRamblerRuServer; bool mHermesServer; + bool mQipServer; unsigned int mLastFetchedSequenceNumber; String * mCurrentFolder; -- cgit v1.2.3