aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/nntp
diff options
context:
space:
mode:
authorGravatar CodaFi <devteam.codafi@gmail.com>2014-08-13 18:53:06 -0600
committerGravatar CodaFi <devteam.codafi@gmail.com>2014-08-13 18:53:06 -0600
commit9fdbf0688e3c8bc9ad94ff8b475ce534749f418d (patch)
tree38992ad8aa6569f34ed58a762a60d68fbcfab0a9 /src/async/nntp
parent38d848cb9c8d64e910804b7b6d559a9a31d2ad99 (diff)
Cosmetic Changes; Fix header includes
Diffstat (limited to 'src/async/nntp')
-rw-r--r--src/async/nntp/MCNNTPAsyncSession.cpp13
-rw-r--r--src/async/nntp/MCNNTPAsyncSession.h5
-rw-r--r--src/async/nntp/MCNNTPFetchMessageOperation.cpp10
-rw-r--r--src/async/nntp/MCNNTPFetchMessageOperation.h4
-rw-r--r--src/async/nntp/MCNNTPFetchMessagesOperation.cpp2
5 files changed, 30 insertions, 4 deletions
diff --git a/src/async/nntp/MCNNTPAsyncSession.cpp b/src/async/nntp/MCNNTPAsyncSession.cpp
index 4aa9b906..ba3b630b 100644
--- a/src/async/nntp/MCNNTPAsyncSession.cpp
+++ b/src/async/nntp/MCNNTPAsyncSession.cpp
@@ -171,15 +171,26 @@ NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(unsigned int i
return op;
}
-NNTPFetchMessageOperation * NNTPAsyncSession::fetchMessageOperation(unsigned int index)
+NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(NNTPMessageInfo * msg)
+{
+ return fetchHeaderOperation(msg->index());
+}
+
+NNTPFetchMessageOperation * NNTPAsyncSession::fetchArticleOperation(String * groupName, unsigned int index)
{
NNTPFetchMessageOperation * op = new NNTPFetchMessageOperation();
op->setSession(this);
+ op->setGroupName(groupName);
op->setMessageIndex(index);
op->autorelease();
return op;
}
+NNTPFetchMessageOperation * NNTPAsyncSession::fetchArticleOperation(String *groupName, NNTPMessageInfo * msg)
+{
+ return fetchArticleOperation(groupName, msg->index());
+}
+
NNTPListNewsgroupsOperation * NNTPAsyncSession::listAllNewsgroupsOperation()
{
diff --git a/src/async/nntp/MCNNTPAsyncSession.h b/src/async/nntp/MCNNTPAsyncSession.h
index ad2ee699..9c214b93 100644
--- a/src/async/nntp/MCNNTPAsyncSession.h
+++ b/src/async/nntp/MCNNTPAsyncSession.h
@@ -9,6 +9,7 @@
namespace mailcore {
class NNTPOperation;
+ class NNTPMessageInfo;
class NNTPSession;
class NNTPFetchHeaderOperation;
class NNTPFetchMessageOperation;
@@ -54,8 +55,10 @@ namespace mailcore {
virtual NNTPFetchMessagesOperation * fetchMessagesOperation(String * group);
virtual NNTPFetchHeaderOperation * fetchHeaderOperation(unsigned int index);
+ virtual NNTPFetchHeaderOperation * fetchHeaderOperation(NNTPMessageInfo * msg);
- virtual NNTPFetchMessageOperation * fetchMessageOperation(unsigned int index);
+ virtual NNTPFetchMessageOperation * fetchArticleOperation(String *groupName, unsigned int index);
+ virtual NNTPFetchMessageOperation * fetchArticleOperation(String *groupName, NNTPMessageInfo * msg);
virtual NNTPListNewsgroupsOperation * listAllNewsgroupsOperation();
virtual NNTPListNewsgroupsOperation * listSubscribedNewsgroupsOperation();
diff --git a/src/async/nntp/MCNNTPFetchMessageOperation.cpp b/src/async/nntp/MCNNTPFetchMessageOperation.cpp
index 3610a51e..2fe02f37 100644
--- a/src/async/nntp/MCNNTPFetchMessageOperation.cpp
+++ b/src/async/nntp/MCNNTPFetchMessageOperation.cpp
@@ -24,6 +24,14 @@ NNTPFetchMessageOperation::~NNTPFetchMessageOperation()
MC_SAFE_RELEASE(mData);
}
+void NNTPFetchMessageOperation::setGroupName(String * groupName) {
+ MC_SAFE_REPLACE_COPY(String, mGroupName, groupName);
+}
+
+String * NNTPFetchMessageOperation::groupName() {
+ return mGroupName;
+}
+
void NNTPFetchMessageOperation::setMessageIndex(unsigned int messageIndex)
{
mMessageIndex = messageIndex;
@@ -42,7 +50,7 @@ Data * NNTPFetchMessageOperation::data()
void NNTPFetchMessageOperation::main()
{
ErrorCode error;
- mData = session()->session()->fetchMessage(mMessageIndex, this, &error);
+ mData = session()->session()->fetchArticle(mGroupName, mMessageIndex, this, &error);
MC_SAFE_RETAIN(mData);
setError(error);
}
diff --git a/src/async/nntp/MCNNTPFetchMessageOperation.h b/src/async/nntp/MCNNTPFetchMessageOperation.h
index f1bb0a65..d038a62f 100644
--- a/src/async/nntp/MCNNTPFetchMessageOperation.h
+++ b/src/async/nntp/MCNNTPFetchMessageOperation.h
@@ -20,6 +20,9 @@ namespace mailcore {
NNTPFetchMessageOperation();
virtual ~NNTPFetchMessageOperation();
+ virtual void setGroupName(String * groupName);
+ virtual String * groupName();
+
virtual void setMessageIndex(unsigned int messageIndex);
virtual unsigned int messageIndex();
@@ -29,6 +32,7 @@ namespace mailcore {
virtual void main();
private:
+ String * mGroupName;
unsigned int mMessageIndex;
Data * mData;
diff --git a/src/async/nntp/MCNNTPFetchMessagesOperation.cpp b/src/async/nntp/MCNNTPFetchMessagesOperation.cpp
index 03a91510..0e0fc239 100644
--- a/src/async/nntp/MCNNTPFetchMessagesOperation.cpp
+++ b/src/async/nntp/MCNNTPFetchMessagesOperation.cpp
@@ -43,7 +43,7 @@ Array * NNTPFetchMessagesOperation::messages()
void NNTPFetchMessagesOperation::main()
{
ErrorCode error;
- mMessages = session()->session()->fetchMessages(mGroupName, &error);
+ mMessages = session()->session()->fetchArticles(mGroupName, &error);
setError(error);
MC_SAFE_RETAIN(mMessages);
}