aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap/MCIMAPGetQuotaOperation.cc
diff options
context:
space:
mode:
authorGravatar Petro Korienev <soxjke@gmail.com>2013-08-08 17:40:45 +0300
committerGravatar Petro Korienev <soxjke@gmail.com>2013-08-08 17:40:45 +0300
commitc6c9d10e66ae6a01fabd6c55c4492566372b59e5 (patch)
tree7ef20e5899dadd35f627fd644d4545b2db68926a /src/async/imap/MCIMAPGetQuotaOperation.cc
parentd5ed180d3615e668a59d098156189616b596a67a (diff)
added getQuota operation to get free space in mailbox
Diffstat (limited to 'src/async/imap/MCIMAPGetQuotaOperation.cc')
-rw-r--r--src/async/imap/MCIMAPGetQuotaOperation.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/async/imap/MCIMAPGetQuotaOperation.cc b/src/async/imap/MCIMAPGetQuotaOperation.cc
new file mode 100644
index 00000000..572bd583
--- /dev/null
+++ b/src/async/imap/MCIMAPGetQuotaOperation.cc
@@ -0,0 +1,42 @@
+//
+// MCIMAPGetQuotaOperation.cc
+// mailcore2
+//
+// Created by Petro Korenev on 8/2/13.
+// Copyright (c) 2013 MailCore. All rights reserved.
+//
+
+#include "MCIMAPGetQuotaOperation.h"
+
+#include "MCIMAPSession.h"
+#include "MCIMAPAsyncConnection.h"
+
+using namespace mailcore;
+
+IMAPGetQuotaOperation::IMAPGetQuotaOperation()
+{
+ mLimit = 0;
+ mUsage = 0;
+}
+
+IMAPGetQuotaOperation::~IMAPGetQuotaOperation()
+{
+}
+
+uint32_t IMAPGetQuotaOperation::limit()
+{
+ return mLimit;
+}
+
+uint32_t IMAPGetQuotaOperation::usage()
+{
+ return mUsage;
+}
+
+void IMAPGetQuotaOperation::main()
+{
+ ErrorCode error;
+ session()->session()->getQuota(&mUsage, &mLimit, &error);
+ fprintf(stderr, "QnIQuESeqUeNcE %d %d", mUsage, mLimit);
+ setError(error);
+}