diff options
-rwxr-xr-x | src/core/imap/MCIMAPSession.cc | 8 | ||||
-rwxr-xr-x | src/core/imap/MCIMAPSession.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/core/imap/MCIMAPSession.cc b/src/core/imap/MCIMAPSession.cc index 8f31856b..5dbe62a6 100755 --- a/src/core/imap/MCIMAPSession.cc +++ b/src/core/imap/MCIMAPSession.cc @@ -342,6 +342,7 @@ void IMAPSession::init() mModSequenceValue = 0; mFolderMsgCount = 0; mFirstUnseenUid = 0; + mYahooServer = false; mLastFetchedSequenceNumber = 0; mCurrentFolder = NULL; pthread_mutex_init(&mIdleLock, NULL); @@ -632,6 +633,7 @@ void IMAPSession::connect(ErrorCode * pError) if (mImap->imap_response != NULL) { MC_SAFE_REPLACE_RETAIN(String, mWelcomeString, String::stringWithUTF8Characters(mImap->imap_response)); + mYahooServer = (mWelcomeString->locationOfString(MCSTR("yahoo.com")) != -1); } * pError = ErrorNone; @@ -2446,7 +2448,11 @@ IndexSet * IMAPSession::search(String * folder, IMAPSearchExpression * expressio clist * result_list = NULL; - int r = mailimap_uid_search(mImap, "utf-8", key, &result_list); + const char * charset = "utf-8"; + if (mYahooServer) { + charset = NULL; + } + int r = mailimap_uid_search(mImap, charset, key, &result_list); mailimap_search_key_free(key); MCLog("had error : %i", r); if (r == MAILIMAP_ERROR_STREAM) { diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h index 97567d65..0a5506ab 100755 --- a/src/core/imap/MCIMAPSession.h +++ b/src/core/imap/MCIMAPSession.h @@ -206,6 +206,7 @@ namespace mailcore { uint64_t mModSequenceValue; unsigned int mFolderMsgCount; uint32_t mFirstUnseenUid; + bool mYahooServer; unsigned int mLastFetchedSequenceNumber; String * mCurrentFolder; |