aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/async/pop/MCPOPAsyncSession.cc5
-rw-r--r--src/async/pop/MCPOPAsyncSession.h4
-rw-r--r--src/objc/pop/MCOPOPSession.h10
-rw-r--r--src/objc/pop/MCOPOPSession.mm6
4 files changed, 24 insertions, 1 deletions
diff --git a/src/async/pop/MCPOPAsyncSession.cc b/src/async/pop/MCPOPAsyncSession.cc
index 2cdbd225..39f356db 100644
--- a/src/async/pop/MCPOPAsyncSession.cc
+++ b/src/async/pop/MCPOPAsyncSession.cc
@@ -144,6 +144,11 @@ POPOperation * POPAsyncSession::deleteMessagesOperation(IndexSet * indexes)
return op;
}
+POPOperation * POPAsyncSession::disconnectOperation()
+{
+ return deleteMessagesOperation(IndexSet::indexSet());
+}
+
POPOperation * POPAsyncSession::checkAccountOperation()
{
POPCheckAccountOperation * op = new POPCheckAccountOperation();
diff --git a/src/async/pop/MCPOPAsyncSession.h b/src/async/pop/MCPOPAsyncSession.h
index f05b98b5..166675e0 100644
--- a/src/async/pop/MCPOPAsyncSession.h
+++ b/src/async/pop/MCPOPAsyncSession.h
@@ -52,7 +52,7 @@ namespace mailcore {
virtual void setCheckCertificateEnabled(bool enabled);
virtual bool isCheckCertificateEnabled();
- virtual POPFetchMessagesOperation * fetchMessagesOperation();
+ virtual POPFetchMessagesOperation * fetchMessagesOperation();
virtual POPFetchHeaderOperation * fetchHeaderOperation(unsigned int index);
@@ -61,6 +61,8 @@ namespace mailcore {
// Will disconnect.
virtual POPOperation * deleteMessagesOperation(IndexSet * indexes);
+ virtual POPOperation * disconnectOperation();
+
virtual POPOperation * checkAccountOperation();
private:
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();