aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap/MCIMAPCustomCommandOperation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/async/imap/MCIMAPCustomCommandOperation.cpp')
-rw-r--r--src/async/imap/MCIMAPCustomCommandOperation.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/async/imap/MCIMAPCustomCommandOperation.cpp b/src/async/imap/MCIMAPCustomCommandOperation.cpp
new file mode 100644
index 00000000..3995d6aa
--- /dev/null
+++ b/src/async/imap/MCIMAPCustomCommandOperation.cpp
@@ -0,0 +1,44 @@
+//
+// MCIMAPCustomCommandOperation.cpp
+// mailcore2
+//
+// Created by Libor Huspenina on 18/10/2015.
+// Copyright © 2015 MailCore. All rights reserved.
+//
+
+#include "MCIMAPCustomCommandOperation.h"
+
+#include "MCIMAPSession.h"
+#include "MCIMAPAsyncConnection.h"
+
+using namespace mailcore;
+
+IMAPCustomCommandOperation::IMAPCustomCommandOperation()
+{
+ mCustomCommand = NULL;
+ mResponse = NULL;
+}
+
+IMAPCustomCommandOperation::~IMAPCustomCommandOperation()
+{
+ MC_SAFE_RELEASE(mCustomCommand);
+ MC_SAFE_RELEASE(mResponse);
+}
+
+void IMAPCustomCommandOperation::setCustomCommand(String * command)
+{
+ MC_SAFE_REPLACE_COPY(String, mCustomCommand, command);
+}
+
+String * IMAPCustomCommandOperation::response()
+{
+ return mResponse;
+}
+
+void IMAPCustomCommandOperation::main()
+{
+ ErrorCode error;
+ mResponse = session()->session()->customCommand(mCustomCommand, &error);
+ MC_SAFE_RETAIN(mResponse);
+ setError(error);
+}