aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap/MCIMAPAsyncConnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/async/imap/MCIMAPAsyncConnection.cpp')
-rwxr-xr-xsrc/async/imap/MCIMAPAsyncConnection.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/async/imap/MCIMAPAsyncConnection.cpp b/src/async/imap/MCIMAPAsyncConnection.cpp
index b2fc24c3..c03422ff 100755
--- a/src/async/imap/MCIMAPAsyncConnection.cpp
+++ b/src/async/imap/MCIMAPAsyncConnection.cpp
@@ -239,8 +239,11 @@ IMAPNamespace * IMAPAsyncConnection::defaultNamespace()
void IMAPAsyncConnection::setClientIdentity(IMAPIdentity * identity)
{
MC_SAFE_REPLACE_COPY(IMAPIdentity, mClientIdentity, identity);
- mc_foreacharray(String, key, identity->allInfoKeys()) {
- mSession->clientIdentity()->setInfoForKey(key, identity->infoForKey(key));
+ mSession->clientIdentity()->removeAllInfos();
+ if (identity != NULL) {
+ mc_foreacharray(String, key, identity->allInfoKeys()) {
+ mSession->clientIdentity()->setInfoForKey(key, identity->infoForKey(key));
+ }
}
}