aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-08-17 19:17:14 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-08-17 19:17:14 -0700
commit11b0dadce55fb4ffe9cfeb6298971066ead8cace (patch)
tree733ff830011e960db18d2b177f4af42c08ea98f7
parent4c41560313cdb4aa57ce9c15ed4285318d99f56c (diff)
Fixed #317: on yahoo servers, don't use charset when searching.
-rwxr-xr-xsrc/core/imap/MCIMAPSession.cc8
-rwxr-xr-xsrc/core/imap/MCIMAPSession.h1
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;