aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/nntp/MCNNTPListNewsgroupsOperation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/async/nntp/MCNNTPListNewsgroupsOperation.cpp')
-rw-r--r--src/async/nntp/MCNNTPListNewsgroupsOperation.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/async/nntp/MCNNTPListNewsgroupsOperation.cpp b/src/async/nntp/MCNNTPListNewsgroupsOperation.cpp
new file mode 100644
index 00000000..3747bacf
--- /dev/null
+++ b/src/async/nntp/MCNNTPListNewsgroupsOperation.cpp
@@ -0,0 +1,48 @@
+//
+// MCNNTPListNewsgroupsMessagesOperation.cpp
+// mailcore2
+//
+// Created by Robert Widmann on 8/13/14.
+// Copyright (c) 2014 MailCore. All rights reserved.
+//
+
+#include "MCNNTPListNewsgroupsOperation.h"
+
+#include "MCNNTPAsyncSession.h"
+#include "MCNNTPSession.h"
+
+using namespace mailcore;
+
+NNTPListNewsgroupsOperation::NNTPListNewsgroupsOperation()
+{
+}
+
+NNTPListNewsgroupsOperation::~NNTPListNewsgroupsOperation()
+{
+}
+
+void NNTPListNewsgroupsOperation::setListsSubscribed(bool listsSubscribed)
+{
+ mListsSuscribed = listsSubscribed;
+}
+
+bool NNTPListNewsgroupsOperation::listsSubscribed()
+{
+ return mListsSuscribed;
+}
+
+Array * NNTPListNewsgroupsOperation::groups() {
+ return mGroups;
+}
+
+void NNTPListNewsgroupsOperation::main()
+{
+ ErrorCode error;
+
+ if (mListsSuscribed) {
+ mGroups = session()->session()->listDefaultNewsgroups(&error);
+ } else {
+ mGroups = session()->session()->listAllNewsgroups(&error);
+ }
+ setError(error);
+}