aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/pop
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-06-22 01:03:56 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-06-22 01:03:56 -0700
commitbd1261b30b44bd624157068c2ac659a649f599c3 (patch)
treecab94313952236b3f92ae9f801272b9e61d183bd /src/objc/pop
parent25eecd728036f8a4a07d639cb0a7a07a9ad5bdd5 (diff)
Fixed #97: manual disconnection of POP session
Diffstat (limited to 'src/objc/pop')
-rw-r--r--src/objc/pop/MCOPOPSession.h10
-rw-r--r--src/objc/pop/MCOPOPSession.mm6
2 files changed, 16 insertions, 0 deletions
diff --git a/src/objc/pop/MCOPOPSession.h b/src/objc/pop/MCOPOPSession.h
index 52f5a9b7..6ecca042 100644
--- a/src/objc/pop/MCOPOPSession.h
+++ b/src/objc/pop/MCOPOPSession.h
@@ -102,6 +102,16 @@ See MCOConnectionType for more information.*/
- (MCOPOPOperation *) deleteMessagesOperationWithIndexes:(MCOIndexSet *)indexes;
/**
+ Returns an operation that will disconnect the session.
+
+ MCOPOPOperation * op = [session disconnectOperation];
+ [op start:^(NSError * error) {
+ ...
+ }];
+ */
+- (MCOPOPOperation *) disconnectOperation;
+
+/**
Returns an operation that will check whether the POP account is valid.
MCOPOPOperation * op = [session checkAccountOperation];
diff --git a/src/objc/pop/MCOPOPSession.mm b/src/objc/pop/MCOPOPSession.mm
index cb060784..10806937 100644
--- a/src/objc/pop/MCOPOPSession.mm
+++ b/src/objc/pop/MCOPOPSession.mm
@@ -80,6 +80,12 @@ MCO_OBJC_SYNTHESIZE_BOOL(setCheckCertificateEnabled, isCheckCertificateEnabled)
return [[[MCOPOPOperation alloc] initWithMCOperation:coreOp] autorelease];
}
+- (MCOPOPOperation *) disconnectOperation
+{
+ mailcore::POPOperation * coreOp = MCO_NATIVE_INSTANCE->disconnectOperation();
+ return [[[MCOPOPOperation alloc] initWithMCOperation:coreOp] autorelease];
+}
+
- (MCOPOPOperation *) checkAccountOperation
{
mailcore::POPOperation * coreOp = MCO_NATIVE_INSTANCE->checkAccountOperation();