diff options
author | Hoà V. DINH <dinh.viet.hoa@gmail.com> | 2016-02-15 20:29:31 -0800 |
---|---|---|
committer | Hoà V. DINH <dinh.viet.hoa@gmail.com> | 2016-02-15 20:29:31 -0800 |
commit | cb5963c42d0cb69df12ea9e2b19cb61298b2831d (patch) | |
tree | b66d3f919df240099d462928f8808add0a810ea5 | |
parent | 5c91ce1ff93adf119af67baf34ef19ab025de7f2 (diff) | |
parent | 2691bc3035a7a8cb14e69191e7adad4e59fbe8a6 (diff) |
Merge pull request #1363 from disaykin/setup-imap-identity
Added ability to customize the identity of IMAP client in the time of…
-rwxr-xr-x | src/async/imap/MCIMAPAsyncSession.cpp | 5 | ||||
-rwxr-xr-x | src/async/imap/MCIMAPAsyncSession.h | 2 | ||||
-rwxr-xr-x | src/core/imap/MCIMAPSession.cpp | 5 | ||||
-rwxr-xr-x | src/core/imap/MCIMAPSession.h | 3 | ||||
-rwxr-xr-x | src/objc/imap/MCOIMAPSession.h | 2 | ||||
-rwxr-xr-x | src/objc/imap/MCOIMAPSession.mm | 5 |
6 files changed, 20 insertions, 2 deletions
diff --git a/src/async/imap/MCIMAPAsyncSession.cpp b/src/async/imap/MCIMAPAsyncSession.cpp index 676d9bc5..976dce95 100755 --- a/src/async/imap/MCIMAPAsyncSession.cpp +++ b/src/async/imap/MCIMAPAsyncSession.cpp @@ -236,6 +236,11 @@ IMAPIdentity * IMAPAsyncSession::clientIdentity() return mClientIdentity; } +void IMAPAsyncSession::setClientIdentity(IMAPIdentity * clientIdentity) +{ + MC_SAFE_REPLACE_COPY(IMAPIdentity, mClientIdentity, clientIdentity); +} + String * IMAPAsyncSession::gmailUserDisplayName() { return mGmailUserDisplayName; diff --git a/src/async/imap/MCIMAPAsyncSession.h b/src/async/imap/MCIMAPAsyncSession.h index b92d8017..f5129a26 100755 --- a/src/async/imap/MCIMAPAsyncSession.h +++ b/src/async/imap/MCIMAPAsyncSession.h @@ -104,6 +104,8 @@ namespace mailcore { virtual IMAPIdentity * serverIdentity(); virtual IMAPIdentity * clientIdentity(); + virtual void setClientIdentity(IMAPIdentity * clientIdentity); + virtual String * gmailUserDisplayName() DEPRECATED_ATTRIBUTE; virtual IMAPFolderInfoOperation * folderInfoOperation(String * folder); diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index 4e92e97f..5af8a7bf 100755 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -3412,6 +3412,11 @@ IMAPIdentity * IMAPSession::clientIdentity() return mClientIdentity; } +void IMAPSession::setClientIdentity(IMAPIdentity * identity) +{ + MC_SAFE_REPLACE_COPY(IMAPIdentity, mClientIdentity, identity); +} + HashMap * IMAPSession::fetchNamespace(ErrorCode * pError) { HashMap * result; diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h index 578350ac..6ce895f6 100755 --- a/src/core/imap/MCIMAPSession.h +++ b/src/core/imap/MCIMAPSession.h @@ -65,7 +65,8 @@ namespace mailcore { virtual IMAPIdentity * serverIdentity(); virtual IMAPIdentity * clientIdentity(); - + virtual void setClientIdentity(IMAPIdentity * identity); + virtual void select(String * folder, ErrorCode * pError); virtual IMAPFolderStatus * folderStatus(String * folder, ErrorCode * pError); diff --git a/src/objc/imap/MCOIMAPSession.h b/src/objc/imap/MCOIMAPSession.h index 6fd5f76e..7674e9db 100755 --- a/src/objc/imap/MCOIMAPSession.h +++ b/src/objc/imap/MCOIMAPSession.h @@ -87,7 +87,7 @@ @property (nonatomic, strong) MCOIMAPNamespace * defaultNamespace; /** The identity of the IMAP client. */ -@property (nonatomic, strong, readonly) MCOIMAPIdentity * clientIdentity; +@property (nonatomic, copy) MCOIMAPIdentity * clientIdentity; /** The identity of the IMAP server. */ @property (nonatomic, strong, readonly) MCOIMAPIdentity * serverIdentity; diff --git a/src/objc/imap/MCOIMAPSession.mm b/src/objc/imap/MCOIMAPSession.mm index c245cdc3..fdd57886 100755 --- a/src/objc/imap/MCOIMAPSession.mm +++ b/src/objc/imap/MCOIMAPSession.mm @@ -122,6 +122,11 @@ MCO_OBJC_SYNTHESIZE_SCALAR(dispatch_queue_t, dispatch_queue_t, setDispatchQueue, return MCO_OBJC_BRIDGE_GET(clientIdentity); } +- (void) setClientIdentity:(MCOIMAPIdentity *)clientIdentity +{ + MCO_OBJC_BRIDGE_SET(setClientIdentity, IMAPIdentity, clientIdentity); +} + - (MCOIMAPIdentity *) serverIdentity { return MCO_OBJC_BRIDGE_GET(serverIdentity); |