diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-04-06 23:51:04 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-04-06 23:51:04 -0700 |
commit | 7db9464d7c53e2529de0005771408f0fac4120f3 (patch) | |
tree | 4612748d66df9f2c83b92a91c3158c5dbb9d140d /src/async/pop | |
parent | 86707e3713ecfebdc518406ea0f67767432922c6 (diff) |
Implemented checkAccount operation for POP
Diffstat (limited to 'src/async/pop')
-rw-r--r-- | src/async/pop/MCPOPAsyncSession.cc | 9 | ||||
-rw-r--r-- | src/async/pop/MCPOPAsyncSession.h | 2 | ||||
-rw-r--r-- | src/async/pop/MCPOPCheckAccountOperation.cpp | 30 | ||||
-rw-r--r-- | src/async/pop/MCPOPCheckAccountOperation.h | 31 |
4 files changed, 72 insertions, 0 deletions
diff --git a/src/async/pop/MCPOPAsyncSession.cc b/src/async/pop/MCPOPAsyncSession.cc index 155dd6e0..2cdbd225 100644 --- a/src/async/pop/MCPOPAsyncSession.cc +++ b/src/async/pop/MCPOPAsyncSession.cc @@ -13,6 +13,7 @@ #include "MCPOPFetchMessageOperation.h" #include "MCPOPDeleteMessagesOperation.h" #include "MCPOPFetchMessagesOperation.h" +#include "MCPOPCheckAccountOperation.h" using namespace mailcore; @@ -143,6 +144,14 @@ POPOperation * POPAsyncSession::deleteMessagesOperation(IndexSet * indexes) return op; } +POPOperation * POPAsyncSession::checkAccountOperation() +{ + POPCheckAccountOperation * op = new POPCheckAccountOperation(); + op->setSession(this); + op->autorelease(); + return op; +} + POPSession * POPAsyncSession::session() { return mSession; diff --git a/src/async/pop/MCPOPAsyncSession.h b/src/async/pop/MCPOPAsyncSession.h index 41ada0ef..f05b98b5 100644 --- a/src/async/pop/MCPOPAsyncSession.h +++ b/src/async/pop/MCPOPAsyncSession.h @@ -61,6 +61,8 @@ namespace mailcore { // Will disconnect. virtual POPOperation * deleteMessagesOperation(IndexSet * indexes); + virtual POPOperation * checkAccountOperation(); + private: POPSession * mSession; OperationQueue * mQueue; diff --git a/src/async/pop/MCPOPCheckAccountOperation.cpp b/src/async/pop/MCPOPCheckAccountOperation.cpp new file mode 100644 index 00000000..f83cd740 --- /dev/null +++ b/src/async/pop/MCPOPCheckAccountOperation.cpp @@ -0,0 +1,30 @@ +// +// MCPOPCheckAccountOperation.cpp +// mailcore2 +// +// Created by DINH Viêt Hoà on 4/6/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#include "MCPOPCheckAccountOperation.h" + +#include "MCPOPAsyncSession.h" +#include "MCPOPSession.h" + +using namespace mailcore; + +POPCheckAccountOperation::POPCheckAccountOperation() +{ +} + +POPCheckAccountOperation::~POPCheckAccountOperation() +{ +} + +void POPCheckAccountOperation::main() +{ + ErrorCode error; + + session()->session()->checkAccount(&error); + setError(error); +} diff --git a/src/async/pop/MCPOPCheckAccountOperation.h b/src/async/pop/MCPOPCheckAccountOperation.h new file mode 100644 index 00000000..50e381fd --- /dev/null +++ b/src/async/pop/MCPOPCheckAccountOperation.h @@ -0,0 +1,31 @@ +// +// MCPOPCheckAccountOperation.h +// mailcore2 +// +// Created by DINH Viêt Hoà on 4/6/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#ifndef __MAILCORE_MCPOPCHECKACCOUNTOPERATION_H_ +#define __MAILCORE_MCPOPCHECKACCOUNTOPERATION_H_ + +#include <MailCore/MCPOPOperation.h> + +#ifdef __cplusplus + +namespace mailcore { + + class POPCheckAccountOperation : public POPOperation { + public: + POPCheckAccountOperation(); + virtual ~POPCheckAccountOperation(); + + public: // subclass behavior + virtual void main(); + }; + +} + +#endif + +#endif |