From a9f8d0676ffa05d13f9968af087d899cbea06e8a Mon Sep 17 00:00:00 2001 From: Dmitry Isaikin Date: Wed, 11 May 2016 22:05:02 +0300 Subject: Detect Rambler server on connect stage (#1424) --- src/core/imap/MCIMAPSession.cpp | 4 +++- src/core/imap/MCIMAPSession.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index f564a435..9847d1cf 100755 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -341,6 +341,7 @@ void IMAPSession::init() mFolderMsgCount = 0; mFirstUnseenUid = 0; mYahooServer = false; + mRamblerRuServer = false; mLastFetchedSequenceNumber = 0; mCurrentFolder = NULL; pthread_mutex_init(&mIdleLock, NULL); @@ -652,6 +653,7 @@ void IMAPSession::connect(ErrorCode * pError) UNLOCK(); mNamespaceEnabled = true; } + mRamblerRuServer = (mHostname->locationOfString(MCSTR(".rambler.ru")) != -1); } mState = STATE_CONNECTED; @@ -2828,7 +2830,7 @@ Data * IMAPSession::fetchMessageAttachment(String * folder, bool identifier_is_u fetch_type = mailimap_fetch_type_new_fetch_att(fetch_att); #ifdef LIBETPAN_HAS_MAILIMAP_RAMBLER_WORKAROUND - if ((encoding == EncodingBase64 || encoding == EncodingUUEncode) && (mHostname->compare(MCSTR("imap.rambler.ru")) == 0)) { + if (mRamblerRuServer && (encoding == EncodingBase64 || encoding == EncodingUUEncode)) { mailimap_set_rambler_workaround_enabled(mImap, 1); } #endif diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h index e9b8130c..8b3fed0f 100755 --- a/src/core/imap/MCIMAPSession.h +++ b/src/core/imap/MCIMAPSession.h @@ -259,6 +259,7 @@ namespace mailcore { unsigned int mFolderMsgCount; uint32_t mFirstUnseenUid; bool mYahooServer; + bool mRamblerRuServer; unsigned int mLastFetchedSequenceNumber; String * mCurrentFolder; -- cgit v1.2.3