Skip to content

Commit a5fd788

Browse files
LinLin
Lin
authored and
Lin
committed
Work well with 163.com
I have try it on my iOS device. it’s works.
1 parent c7e19c3 commit a5fd788

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/async/imap/MCIMAPAsyncSession.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ IMAPAsyncSession::~IMAPAsyncSession()
9797
void IMAPAsyncSession::setHostname(String * hostname)
9898
{
9999
MC_SAFE_REPLACE_COPY(String, mHostname, hostname);
100+
101+
102+
if(!mNetEaseWorkaroundEnabled && hostname
103+
&& (hostname->hasSuffix(String::stringWithUTF8Characters((char *) ".163.com"))
104+
|| hostname->hasSuffix(String::stringWithUTF8Characters((char *) ".126.com"))
105+
|| hostname->hasSuffix(String::stringWithUTF8Characters((char *) ".yeah.net"))
106+
)) {
107+
mNetEaseWorkaroundEnabled = true;
108+
}
100109
}
101110

102111
String * IMAPAsyncSession::hostname()

src/core/imap/MCIMAPSession.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,6 @@ IMAPSession::~IMAPSession()
381381
void IMAPSession::setHostname(String * hostname)
382382
{
383383
MC_SAFE_REPLACE_COPY(String, mHostname, hostname);
384-
385-
if(!mNetEaseWorkaroundEnabled && hostname
386-
&& (hostname->hasSuffix(String::stringWithUTF8Characters((char *) ".163.com"))
387-
|| hostname->hasSuffix(String::stringWithUTF8Characters((char *) ".126.com"))
388-
|| hostname->hasSuffix(String::stringWithUTF8Characters((char *) ".yeah.net"))
389-
)) {
390-
mNetEaseWorkaroundEnabled = true;
391-
}
392384
}
393385

394386
String * IMAPSession::hostname()

src/objc/imap/MCOIMAPSession.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
@property (nonatomic, assign, getter=isVoIPEnabled) BOOL voIPEnabled;
8383

8484
/** When set to YES, the workaround for NetEase's imap server will be enabled on the IMAP connection on iOS */
85-
@property (nonatomic, assign, getter=isVoIPEnabled) BOOL netEaseWorkaroundEnabled;
85+
@property (nonatomic, assign, getter=isNetEaseWorkaroundEnabled) BOOL netEaseWorkaroundEnabled;
8686

8787
/** The default namespace. */
8888
@property (nonatomic, strong) MCOIMAPNamespace * defaultNamespace;

0 commit comments

Comments
 (0)