aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar CodaFi <devteam.codafi@gmail.com>2014-08-13 19:11:10 -0600
committerGravatar CodaFi <devteam.codafi@gmail.com>2014-08-13 19:11:10 -0600
commit5f82321bf14e8836da9d9a9f9caf9f12d021eef8 (patch)
tree10dad00a41cdb224bde372697827ac746dbf66a4 /src
parent9fdbf0688e3c8bc9ad94ff8b475ce534749f418d (diff)
cpp -> cc
Diffstat (limited to 'src')
-rw-r--r--src/async/nntp/MCAsyncNNTP.h4
-rw-r--r--src/async/nntp/MCNNTPAsyncSession.cc (renamed from src/async/nntp/MCNNTPAsyncSession.cpp)21
-rw-r--r--src/async/nntp/MCNNTPAsyncSession.h14
-rw-r--r--src/async/nntp/MCNNTPCheckAccountOperation.cc (renamed from src/async/nntp/MCNNTPCheckAccountOperation.cpp)0
-rw-r--r--src/async/nntp/MCNNTPDisconnectOperation.cc (renamed from src/async/nntp/MCNNTPDisconnectOperation.cpp)0
-rw-r--r--src/async/nntp/MCNNTPFetchArticleOperation.cc (renamed from src/async/nntp/MCNNTPFetchMessageOperation.cpp)20
-rw-r--r--src/async/nntp/MCNNTPFetchArticleOperation.h (renamed from src/async/nntp/MCNNTPFetchMessageOperation.h)8
-rw-r--r--src/async/nntp/MCNNTPFetchArticlesOperation.cc (renamed from src/async/nntp/MCNNTPFetchMessagesOperation.cpp)16
-rw-r--r--src/async/nntp/MCNNTPFetchArticlesOperation.h (renamed from src/async/nntp/MCNNTPFetchMessagesOperation.h)8
-rw-r--r--src/async/nntp/MCNNTPFetchHeaderOperation.cc (renamed from src/async/nntp/MCNNTPFetchHeaderOperation.cpp)10
-rw-r--r--src/async/nntp/MCNNTPFetchHeaderOperation.h4
-rw-r--r--src/async/nntp/MCNNTPListNewsgroupsOperation.cc (renamed from src/async/nntp/MCNNTPListNewsgroupsOperation.cpp)0
-rw-r--r--src/async/nntp/MCNNTPOperation.cc (renamed from src/async/nntp/MCNNTPOperation.cpp)0
-rw-r--r--src/core/nntp/MCNNTPGroupInfo.cc (renamed from src/core/nntp/MCNNTPGroupInfo.cpp)0
-rw-r--r--src/core/nntp/MCNNTPMessageInfo.cc (renamed from src/core/nntp/MCNNTPMessageInfo.cpp)0
-rw-r--r--src/core/nntp/MCNNTPSession.cc (renamed from src/core/nntp/MCNNTPSession.cpp)14
-rw-r--r--src/core/nntp/MCNNTPSession.h4
-rw-r--r--src/objc/nntp/MCONNTP.h5
-rw-r--r--src/objc/nntp/MCONNTPFetchArticleOperation.h (renamed from src/objc/nntp/MCONNTPFetchMessageOperation.h)4
-rw-r--r--src/objc/nntp/MCONNTPFetchArticleOperation.mm (renamed from src/objc/nntp/MCONNTPFetchMessageOperation.mm)22
-rw-r--r--src/objc/nntp/MCONNTPFetchArticlesOperation.h (renamed from src/objc/nntp/MCONNTPFetchMessagesOperation.h)4
-rw-r--r--src/objc/nntp/MCONNTPFetchArticlesOperation.mm (renamed from src/objc/nntp/MCONNTPFetchMessagesOperation.mm)8
-rw-r--r--src/objc/nntp/MCONNTPMessageInfo.h2
-rw-r--r--src/objc/nntp/MCONNTPSession.h16
-rw-r--r--src/objc/nntp/MCONNTPSession.mm14
25 files changed, 108 insertions, 90 deletions
diff --git a/src/async/nntp/MCAsyncNNTP.h b/src/async/nntp/MCAsyncNNTP.h
index e96788ca..56509ff8 100644
--- a/src/async/nntp/MCAsyncNNTP.h
+++ b/src/async/nntp/MCAsyncNNTP.h
@@ -13,8 +13,8 @@
#include <MailCore/MCNNTPAsyncSession.h>
#include <MailCore/MCNNTPOperation.h>
#include <MailCore/MCNNTPFetchHeaderOperation.h>
-#include <MailCore/MCNNTPFetchMessageOperation.h>
-#include <MailCore/MCNNTPFetchMessagesOperation.h>
+#include <MailCore/MCNNTPFetchArticleOperation.h>
+#include <MailCore/MCNNTPFetchArticlesOperation.h>
#include <MailCore/MCNNTPListNewsgroupsOperation.h>
#include <MailCore/MCNNTPOperationCallback.h>
diff --git a/src/async/nntp/MCNNTPAsyncSession.cpp b/src/async/nntp/MCNNTPAsyncSession.cc
index ba3b630b..84b5f318 100644
--- a/src/async/nntp/MCNNTPAsyncSession.cpp
+++ b/src/async/nntp/MCNNTPAsyncSession.cc
@@ -10,8 +10,8 @@
#include "MCNNTP.h"
#include "MCNNTPFetchHeaderOperation.h"
-#include "MCNNTPFetchMessageOperation.h"
-#include "MCNNTPFetchMessagesOperation.h"
+#include "MCNNTPFetchArticleOperation.h"
+#include "MCNNTPFetchArticlesOperation.h"
#include "MCNNTPListNewsgroupsOperation.h"
#include "MCNNTPCheckAccountOperation.h"
#include "MCNNTPDisconnectOperation.h"
@@ -153,32 +153,33 @@ bool NNTPAsyncSession::isCheckCertificateEnabled()
return mSession->isCheckCertificateEnabled();
}
-NNTPFetchMessagesOperation * NNTPAsyncSession::fetchMessagesOperation(String * group)
+MCNNTPFetchArticlesOperation * NNTPAsyncSession::fetchArticlesOperation(String * group)
{
- NNTPFetchMessagesOperation * op = new NNTPFetchMessagesOperation();
+ MCNNTPFetchArticlesOperation * op = new MCNNTPFetchArticlesOperation();
op->setSession(this);
op->setGroupName(group);
op->autorelease();
return op;
}
-NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(unsigned int index)
+NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(String * groupName, unsigned int index)
{
NNTPFetchHeaderOperation * op = new NNTPFetchHeaderOperation();
op->setSession(this);
+ op->setGroupName(groupName);
op->setMessageIndex(index);
op->autorelease();
return op;
}
-NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(NNTPMessageInfo * msg)
+NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(String * groupName, NNTPMessageInfo * msg)
{
- return fetchHeaderOperation(msg->index());
+ return fetchHeaderOperation(groupName, msg->index());
}
-NNTPFetchMessageOperation * NNTPAsyncSession::fetchArticleOperation(String * groupName, unsigned int index)
+NNTPFetchArticleOperation * NNTPAsyncSession::fetchArticleOperation(String * groupName, unsigned int index)
{
- NNTPFetchMessageOperation * op = new NNTPFetchMessageOperation();
+ NNTPFetchArticleOperation * op = new NNTPFetchArticleOperation();
op->setSession(this);
op->setGroupName(groupName);
op->setMessageIndex(index);
@@ -186,7 +187,7 @@ NNTPFetchMessageOperation * NNTPAsyncSession::fetchArticleOperation(String * gro
return op;
}
-NNTPFetchMessageOperation * NNTPAsyncSession::fetchArticleOperation(String *groupName, NNTPMessageInfo * msg)
+NNTPFetchArticleOperation * NNTPAsyncSession::fetchArticleOperation(String *groupName, NNTPMessageInfo * msg)
{
return fetchArticleOperation(groupName, msg->index());
}
diff --git a/src/async/nntp/MCNNTPAsyncSession.h b/src/async/nntp/MCNNTPAsyncSession.h
index 9c214b93..501985bc 100644
--- a/src/async/nntp/MCNNTPAsyncSession.h
+++ b/src/async/nntp/MCNNTPAsyncSession.h
@@ -12,8 +12,8 @@ namespace mailcore {
class NNTPMessageInfo;
class NNTPSession;
class NNTPFetchHeaderOperation;
- class NNTPFetchMessageOperation;
- class NNTPFetchMessagesOperation;
+ class NNTPFetchArticleOperation;
+ class MCNNTPFetchArticlesOperation;
class NNTPListNewsgroupsOperation;
class NNTPOperationQueueCallback;
class NNTPConnectionLogger;
@@ -52,13 +52,13 @@ namespace mailcore {
virtual dispatch_queue_t dispatchQueue();
#endif
- virtual NNTPFetchMessagesOperation * fetchMessagesOperation(String * group);
+ virtual MCNNTPFetchArticlesOperation * fetchArticlesOperation(String * group);
- virtual NNTPFetchHeaderOperation * fetchHeaderOperation(unsigned int index);
- virtual NNTPFetchHeaderOperation * fetchHeaderOperation(NNTPMessageInfo * msg);
+ virtual NNTPFetchHeaderOperation * fetchHeaderOperation(String * groupName, unsigned int index);
+ virtual NNTPFetchHeaderOperation * fetchHeaderOperation(String * groupName, NNTPMessageInfo * msg);
- virtual NNTPFetchMessageOperation * fetchArticleOperation(String *groupName, unsigned int index);
- virtual NNTPFetchMessageOperation * fetchArticleOperation(String *groupName, NNTPMessageInfo * msg);
+ virtual NNTPFetchArticleOperation * fetchArticleOperation(String *groupName, unsigned int index);
+ virtual NNTPFetchArticleOperation * fetchArticleOperation(String *groupName, NNTPMessageInfo * msg);
virtual NNTPListNewsgroupsOperation * listAllNewsgroupsOperation();
virtual NNTPListNewsgroupsOperation * listSubscribedNewsgroupsOperation();
diff --git a/src/async/nntp/MCNNTPCheckAccountOperation.cpp b/src/async/nntp/MCNNTPCheckAccountOperation.cc
index 29b050f0..29b050f0 100644
--- a/src/async/nntp/MCNNTPCheckAccountOperation.cpp
+++ b/src/async/nntp/MCNNTPCheckAccountOperation.cc
diff --git a/src/async/nntp/MCNNTPDisconnectOperation.cpp b/src/async/nntp/MCNNTPDisconnectOperation.cc
index d269904a..d269904a 100644
--- a/src/async/nntp/MCNNTPDisconnectOperation.cpp
+++ b/src/async/nntp/MCNNTPDisconnectOperation.cc
diff --git a/src/async/nntp/MCNNTPFetchMessageOperation.cpp b/src/async/nntp/MCNNTPFetchArticleOperation.cc
index 2fe02f37..a12f346f 100644
--- a/src/async/nntp/MCNNTPFetchMessageOperation.cpp
+++ b/src/async/nntp/MCNNTPFetchArticleOperation.cc
@@ -1,53 +1,53 @@
//
-// MCNNTPFetchMessagesOperation.cpp
+// MCMCNNTPFetchArticlesOperation.cpp
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
// Copyright (c) 2014 MailCore. All rights reserved.
//
-#include "MCNNTPFetchMessageOperation.h"
+#include "MCNNTPFetchArticleOperation.h"
#include "MCNNTPAsyncSession.h"
#include "MCNNTPSession.h"
using namespace mailcore;
-NNTPFetchMessageOperation::NNTPFetchMessageOperation()
+NNTPFetchArticleOperation::NNTPFetchArticleOperation()
{
mMessageIndex = 0;
mData = NULL;
}
-NNTPFetchMessageOperation::~NNTPFetchMessageOperation()
+NNTPFetchArticleOperation::~NNTPFetchArticleOperation()
{
MC_SAFE_RELEASE(mData);
}
-void NNTPFetchMessageOperation::setGroupName(String * groupName) {
+void NNTPFetchArticleOperation::setGroupName(String * groupName) {
MC_SAFE_REPLACE_COPY(String, mGroupName, groupName);
}
-String * NNTPFetchMessageOperation::groupName() {
+String * NNTPFetchArticleOperation::groupName() {
return mGroupName;
}
-void NNTPFetchMessageOperation::setMessageIndex(unsigned int messageIndex)
+void NNTPFetchArticleOperation::setMessageIndex(unsigned int messageIndex)
{
mMessageIndex = messageIndex;
}
-unsigned int NNTPFetchMessageOperation::messageIndex()
+unsigned int NNTPFetchArticleOperation::messageIndex()
{
return mMessageIndex;
}
-Data * NNTPFetchMessageOperation::data()
+Data * NNTPFetchArticleOperation::data()
{
return mData;
}
-void NNTPFetchMessageOperation::main()
+void NNTPFetchArticleOperation::main()
{
ErrorCode error;
mData = session()->session()->fetchArticle(mGroupName, mMessageIndex, this, &error);
diff --git a/src/async/nntp/MCNNTPFetchMessageOperation.h b/src/async/nntp/MCNNTPFetchArticleOperation.h
index d038a62f..f43799a9 100644
--- a/src/async/nntp/MCNNTPFetchMessageOperation.h
+++ b/src/async/nntp/MCNNTPFetchArticleOperation.h
@@ -1,5 +1,5 @@
//
-// MCNNTPFetchMessagesOperation.h
+// MCMCNNTPFetchArticlesOperation.h
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
@@ -15,10 +15,10 @@
#ifdef __cplusplus
namespace mailcore {
- class NNTPFetchMessageOperation : public NNTPOperation {
+ class NNTPFetchArticleOperation : public NNTPOperation {
public:
- NNTPFetchMessageOperation();
- virtual ~NNTPFetchMessageOperation();
+ NNTPFetchArticleOperation();
+ virtual ~NNTPFetchArticleOperation();
virtual void setGroupName(String * groupName);
virtual String * groupName();
diff --git a/src/async/nntp/MCNNTPFetchMessagesOperation.cpp b/src/async/nntp/MCNNTPFetchArticlesOperation.cc
index 0e0fc239..41e3281f 100644
--- a/src/async/nntp/MCNNTPFetchMessagesOperation.cpp
+++ b/src/async/nntp/MCNNTPFetchArticlesOperation.cc
@@ -1,46 +1,46 @@
//
-// MCNNTPFetchMessagesOperation.cpp
+// MCMCNNTPFetchArticlesOperation.cpp
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
// Copyright (c) 2014 MailCore. All rights reserved.
//
-#include "MCNNTPFetchMessagesOperation.h"
+#include "MCNNTPFetchArticlesOperation.h"
#include "MCNNTPAsyncSession.h"
#include "MCNNTPSession.h"
using namespace mailcore;
-NNTPFetchMessagesOperation::NNTPFetchMessagesOperation()
+MCNNTPFetchArticlesOperation::MCNNTPFetchArticlesOperation()
{
mGroupName = NULL;
mMessages = NULL;
}
-NNTPFetchMessagesOperation::~NNTPFetchMessagesOperation()
+MCNNTPFetchArticlesOperation::~MCNNTPFetchArticlesOperation()
{
MC_SAFE_RELEASE(mGroupName);
MC_SAFE_RELEASE(mMessages);
}
-void NNTPFetchMessagesOperation::setGroupName(String * groupname)
+void MCNNTPFetchArticlesOperation::setGroupName(String * groupname)
{
MC_SAFE_REPLACE_COPY(String, mGroupName, groupname);
}
-String * NNTPFetchMessagesOperation::groupName()
+String * MCNNTPFetchArticlesOperation::groupName()
{
return mGroupName;
}
-Array * NNTPFetchMessagesOperation::messages()
+Array * MCNNTPFetchArticlesOperation::messages()
{
return mMessages;
}
-void NNTPFetchMessagesOperation::main()
+void MCNNTPFetchArticlesOperation::main()
{
ErrorCode error;
mMessages = session()->session()->fetchArticles(mGroupName, &error);
diff --git a/src/async/nntp/MCNNTPFetchMessagesOperation.h b/src/async/nntp/MCNNTPFetchArticlesOperation.h
index 91390c1f..9fe6fd1b 100644
--- a/src/async/nntp/MCNNTPFetchMessagesOperation.h
+++ b/src/async/nntp/MCNNTPFetchArticlesOperation.h
@@ -1,5 +1,5 @@
//
-// MCNNTPFetchMessagesOperation.h
+// MCMCNNTPFetchArticlesOperation.h
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
@@ -16,10 +16,10 @@
namespace mailcore {
- class NNTPFetchMessagesOperation : public NNTPOperation {
+ class MCNNTPFetchArticlesOperation : public NNTPOperation {
public:
- NNTPFetchMessagesOperation();
- virtual ~NNTPFetchMessagesOperation();
+ MCNNTPFetchArticlesOperation();
+ virtual ~MCNNTPFetchArticlesOperation();
virtual void setGroupName(String * groupName);
virtual String * groupName();
diff --git a/src/async/nntp/MCNNTPFetchHeaderOperation.cpp b/src/async/nntp/MCNNTPFetchHeaderOperation.cc
index ea374527..386dc142 100644
--- a/src/async/nntp/MCNNTPFetchHeaderOperation.cpp
+++ b/src/async/nntp/MCNNTPFetchHeaderOperation.cc
@@ -25,6 +25,14 @@ NNTPFetchHeaderOperation::~NNTPFetchHeaderOperation()
MC_SAFE_RELEASE(mHeader);
}
+void NNTPFetchHeaderOperation::setGroupName(String * groupName) {
+ MC_SAFE_REPLACE_COPY(String, mGroupName, groupName);
+}
+
+String * NNTPFetchHeaderOperation::groupName() {
+ return mGroupName;
+}
+
void NNTPFetchHeaderOperation::setMessageIndex(unsigned int messageIndex)
{
mMessageIndex = messageIndex;
@@ -43,7 +51,7 @@ MessageHeader * NNTPFetchHeaderOperation::header()
void NNTPFetchHeaderOperation::main()
{
ErrorCode error;
- mHeader = session()->session()->fetchHeader(mMessageIndex, &error);
+ mHeader = session()->session()->fetchHeader(mGroupName, mMessageIndex, &error);
if (mHeader != NULL) {
mHeader->retain();
}
diff --git a/src/async/nntp/MCNNTPFetchHeaderOperation.h b/src/async/nntp/MCNNTPFetchHeaderOperation.h
index 91ded8ee..97b12b05 100644
--- a/src/async/nntp/MCNNTPFetchHeaderOperation.h
+++ b/src/async/nntp/MCNNTPFetchHeaderOperation.h
@@ -23,6 +23,9 @@ namespace mailcore {
NNTPFetchHeaderOperation();
virtual ~NNTPFetchHeaderOperation();
+ virtual void setGroupName(String * groupName);
+ virtual String * groupName();
+
virtual void setMessageIndex(unsigned int messageIndex);
virtual unsigned int messageIndex();
@@ -32,6 +35,7 @@ namespace mailcore {
virtual void main();
private:
+ String * mGroupName;
unsigned int mMessageIndex;
MessageHeader * mHeader;
diff --git a/src/async/nntp/MCNNTPListNewsgroupsOperation.cpp b/src/async/nntp/MCNNTPListNewsgroupsOperation.cc
index 253b38d0..253b38d0 100644
--- a/src/async/nntp/MCNNTPListNewsgroupsOperation.cpp
+++ b/src/async/nntp/MCNNTPListNewsgroupsOperation.cc
diff --git a/src/async/nntp/MCNNTPOperation.cpp b/src/async/nntp/MCNNTPOperation.cc
index 3368ba0e..3368ba0e 100644
--- a/src/async/nntp/MCNNTPOperation.cpp
+++ b/src/async/nntp/MCNNTPOperation.cc
diff --git a/src/core/nntp/MCNNTPGroupInfo.cpp b/src/core/nntp/MCNNTPGroupInfo.cc
index 0f941348..0f941348 100644
--- a/src/core/nntp/MCNNTPGroupInfo.cpp
+++ b/src/core/nntp/MCNNTPGroupInfo.cc
diff --git a/src/core/nntp/MCNNTPMessageInfo.cpp b/src/core/nntp/MCNNTPMessageInfo.cc
index 474de9b3..474de9b3 100644
--- a/src/core/nntp/MCNNTPMessageInfo.cpp
+++ b/src/core/nntp/MCNNTPMessageInfo.cc
diff --git a/src/core/nntp/MCNNTPSession.cpp b/src/core/nntp/MCNNTPSession.cc
index bad1ebb4..a31abb1d 100644
--- a/src/core/nntp/MCNNTPSession.cpp
+++ b/src/core/nntp/MCNNTPSession.cc
@@ -401,7 +401,7 @@ Array * NNTPSession::listSubscribedNewsgroups(ErrorCode * pError)
return result;
}
-MessageHeader * NNTPSession::fetchHeader(unsigned int index, ErrorCode * pError)
+MessageHeader * NNTPSession::fetchHeader(String *groupName, unsigned int index, ErrorCode * pError)
{
int r;
char * content;
@@ -409,8 +409,14 @@ MessageHeader * NNTPSession::fetchHeader(unsigned int index, ErrorCode * pError)
MCLog("fetch header at index %u", index);
loginIfNeeded(pError);
- if (* pError != ErrorNone)
+ if (* pError != ErrorNone) {
+ return NULL;
+ }
+
+ selectGroup(groupName, pError);
+ if (* pError != ErrorNone) {
return NULL;
+ }
r = newsnntp_head(mNNTP, index, &content, &content_len);
if (r != NEWSNNTP_NO_ERROR) {
@@ -431,9 +437,9 @@ MessageHeader * NNTPSession::fetchHeader(unsigned int index, ErrorCode * pError)
return result;
}
-MessageHeader * NNTPSession::fetchHeader(NNTPMessageInfo * msg, ErrorCode * pError)
+MessageHeader * NNTPSession::fetchHeader(String *groupName, NNTPMessageInfo * msg, ErrorCode * pError)
{
- return fetchHeader(msg->index(), pError);
+ return fetchHeader(groupName, msg->index(), pError);
}
Data * NNTPSession::fetchArticle(String *groupName, unsigned int index, NNTPProgressCallback * callback, ErrorCode * pError)
diff --git a/src/core/nntp/MCNNTPSession.h b/src/core/nntp/MCNNTPSession.h
index 6f8bf73a..d166354c 100644
--- a/src/core/nntp/MCNNTPSession.h
+++ b/src/core/nntp/MCNNTPSession.h
@@ -48,8 +48,8 @@ namespace mailcore {
virtual Array * /* NNTPGroupInfo */ listAllNewsgroups(ErrorCode * pError);
virtual Array * listSubscribedNewsgroups(ErrorCode * pError);
- virtual MessageHeader * fetchHeader(unsigned int index, ErrorCode * pError);
- virtual MessageHeader * fetchHeader(NNTPMessageInfo * msg, ErrorCode * pError);
+ virtual MessageHeader * fetchHeader(String *groupName, unsigned int index, ErrorCode * pError);
+ virtual MessageHeader * fetchHeader(String *groupName, NNTPMessageInfo * msg, ErrorCode * pError);
virtual Array * /* NNTPMessageInfo */ fetchArticles(String * groupname, ErrorCode * pError);
diff --git a/src/objc/nntp/MCONNTP.h b/src/objc/nntp/MCONNTP.h
index f96f296c..20eb035b 100644
--- a/src/objc/nntp/MCONNTP.h
+++ b/src/objc/nntp/MCONNTP.h
@@ -13,11 +13,10 @@
#include <MailCore/MCONNTPSession.h>
#include <MailCore/MCONNTPOperation.h>
#include <MailCore/MCONNTPFetchHeaderOperation.h>
-#include <MailCore/MCONNTPFetchMessageOperation.h>
-#include <MailCore/MCONNTPFetchMessagesOperation.h>
+#include <MailCore/MCONNTPFetchArticleOperation.h>
+#include <MailCore/MCONNTPFetchArticlesOperation.h>
#include <MailCore/MCONNTPListNewsgroupsOperation.h>
#include <MailCore/MCONNTPMessageInfo.h>
#include <MailCore/MCONNTPGroupInfo.h>
-#include <MailCore/MCONNTPOperationCallback.h>
#endif
diff --git a/src/objc/nntp/MCONNTPFetchMessageOperation.h b/src/objc/nntp/MCONNTPFetchArticleOperation.h
index c0cfbf68..c72351d9 100644
--- a/src/objc/nntp/MCONNTPFetchMessageOperation.h
+++ b/src/objc/nntp/MCONNTPFetchArticleOperation.h
@@ -1,5 +1,5 @@
//
-// MCONNTPFetchMessageOperation.h
+// MCONNTPFetchArticleOperation.h
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
@@ -17,7 +17,7 @@
typedef void (^MCONNTPOperationProgressBlock)(unsigned int current, unsigned int maximum);
-@interface MCONNTPFetchMessageOperation : MCONNTPOperation
+@interface MCONNTPFetchArticleOperation : MCONNTPOperation
/** This block will be called as data is downloaded from the network */
@property (nonatomic, copy) MCONNTPOperationProgressBlock progress;
diff --git a/src/objc/nntp/MCONNTPFetchMessageOperation.mm b/src/objc/nntp/MCONNTPFetchArticleOperation.mm
index 6de52de3..1d43d1b6 100644
--- a/src/objc/nntp/MCONNTPFetchMessageOperation.mm
+++ b/src/objc/nntp/MCONNTPFetchArticleOperation.mm
@@ -1,35 +1,35 @@
//
-// MCONNTPFetchMessageOperation.m
+// MCONNTPFetchArticleOperation.m
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
// Copyright (c) 2014 MailCore. All rights reserved.
//
-#import "MCONNTPFetchMessageOperation.h"
+#import "MCONNTPFetchArticleOperation.h"
#import "MCAsyncNNTP.h"
#import "MCOUtils.h"
#import "MCOOperation+Private.h"
-#define nativeType mailcore::NNTPFetchMessageOperation
+#define nativeType mailcore::NNTPFetchArticleOperation
typedef void (^CompletionType)(NSError *error, NSData * messageData);
-@interface MCONNTPFetchMessageOperation ()
+@interface MCONNTPFetchArticleOperation ()
- (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum;
@end
-class MCONNTPFetchMessageOperationCallback : public mailcore::NNTPOperationCallback {
+class MCONNTPFetchArticleOperationCallback : public mailcore::NNTPOperationCallback {
public:
- MCONNTPFetchMessageOperationCallback(MCONNTPFetchMessageOperation * op)
+ MCONNTPFetchArticleOperationCallback(MCONNTPFetchArticleOperation * op)
{
mOperation = op;
}
- virtual ~MCONNTPFetchMessageOperationCallback()
+ virtual ~MCONNTPFetchArticleOperationCallback()
{
}
@@ -38,12 +38,12 @@ public:
}
private:
- MCONNTPFetchMessageOperation * mOperation;
+ MCONNTPFetchArticleOperation * mOperation;
};
-@implementation MCONNTPFetchMessageOperation {
+@implementation MCONNTPFetchArticleOperation {
CompletionType _completionBlock;
- MCONNTPFetchMessageOperationCallback * _popCallback;
+ MCONNTPFetchArticleOperationCallback * _popCallback;
MCONNTPOperationProgressBlock _progress;
}
@@ -64,7 +64,7 @@ private:
{
self = [super initWithMCOperation:op];
- _popCallback = new MCONNTPFetchMessageOperationCallback(self);
+ _popCallback = new MCONNTPFetchArticleOperationCallback(self);
((mailcore::NNTPOperation *) op)->setNNTPCallback(_popCallback);
return self;
diff --git a/src/objc/nntp/MCONNTPFetchMessagesOperation.h b/src/objc/nntp/MCONNTPFetchArticlesOperation.h
index 57159ad0..bd28d99d 100644
--- a/src/objc/nntp/MCONNTPFetchMessagesOperation.h
+++ b/src/objc/nntp/MCONNTPFetchArticlesOperation.h
@@ -1,5 +1,5 @@
//
-// MCONNTPFetchMessagesOperation.h
+// MCONNTPFetchArticlesOperation.h
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
@@ -15,7 +15,7 @@
/** This is an asynchronous operation that will fetch the list of a messages on the NNTP3 account. */
-@interface MCONNTPFetchMessagesOperation : MCONNTPOperation
+@interface MCONNTPFetchArticlesOperation : MCONNTPOperation
/**
Starts the asynchronous fetch operation.
diff --git a/src/objc/nntp/MCONNTPFetchMessagesOperation.mm b/src/objc/nntp/MCONNTPFetchArticlesOperation.mm
index 338af1fa..b7c4670e 100644
--- a/src/objc/nntp/MCONNTPFetchMessagesOperation.mm
+++ b/src/objc/nntp/MCONNTPFetchArticlesOperation.mm
@@ -1,12 +1,12 @@
//
-// MCONNTPFetchMessagesOperation.m
+// MCONNTPFetchArticlesOperation.m
// mailcore2
//
// Created by Robert Widmann on 8/13/14.
// Copyright (c) 2014 MailCore. All rights reserved.
//
-#import "MCONNTPFetchMessagesOperation.h"
+#import "MCONNTPFetchArticlesOperation.h"
#include "MCAsyncNNTP.h"
@@ -15,11 +15,11 @@
typedef void (^CompletionType)(NSError *error, NSArray * messages);
-@implementation MCONNTPFetchMessagesOperation {
+@implementation MCONNTPFetchArticlesOperation {
CompletionType _completionBlock;
}
-#define nativeType mailcore::NNTPFetchMessagesOperation
+#define nativeType mailcore::MCNNTPFetchArticlesOperation
+ (void) load
{
diff --git a/src/objc/nntp/MCONNTPMessageInfo.h b/src/objc/nntp/MCONNTPMessageInfo.h
index 0b62547a..d4f06b04 100644
--- a/src/objc/nntp/MCONNTPMessageInfo.h
+++ b/src/objc/nntp/MCONNTPMessageInfo.h
@@ -12,7 +12,7 @@
#import <Foundation/Foundation.h>
-/** This is information of a message fetched by MCONNTPFetchMessagesOperation.*/
+/** This is information of a message fetched by MCONNTPFetchArticlesOperation.*/
@interface MCONNTPMessageInfo : NSObject <NSCopying>
diff --git a/src/objc/nntp/MCONNTPSession.h b/src/objc/nntp/MCONNTPSession.h
index 214e9d9d..6d6ea26f 100644
--- a/src/objc/nntp/MCONNTPSession.h
+++ b/src/objc/nntp/MCONNTPSession.h
@@ -16,9 +16,9 @@
#import <MailCore/MCOConstants.h>
-@class MCONNTPFetchMessagesOperation;
+@class MCONNTPFetchArticlesOperation;
@class MCONNTPFetchHeaderOperation;
-@class MCONNTPFetchMessageOperation;
+@class MCONNTPFetchArticleOperation;
@class MCONNTPListNewsgroupsOperation;
@class MCONNTPOperation;
@@ -68,33 +68,33 @@
/**
Returns an operation that will fetch the list of messages.
- MCONNTPFetchMessagesOperation * op = [session fetchMessagesOperation];
+ MCONNTPFetchArticlesOperation * op = [session fetchMessagesOperation];
[op start:^(NSError * error, NSArray * messages) {
// messages is an array of MCONNTPMessageInfo
// [info index] can be used as reference for a given message in the other operations.
}];
*/
-- (MCONNTPFetchMessagesOperation *) fetchMessagesOperation:(NSString *)group;
+- (MCONNTPFetchArticlesOperation *) fetchArticlesOperation:(NSString *)group;
/**
Returns an operation that will fetch the header of the given message.
- MCONNTPFetchHeaderOperation * op = [session fetchHeaderOperationWithIndex:idx];
+ MCONNTPFetchHeaderOperation * op = [session fetchHeaderOperationWithIndex:idx inGroup:@"Group"];
[op start:^(NSError * error, MCOMessageHeader * header) {
// header is the parsed header of the message.
}];
*/
-- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index;
+- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index inGroup:(NSString *)group;
/**
Returns an operation that will fetch the content of the given message.
- MCONNTPFetchMessageOperation * op = [session fetchMessageOperationWithIndex:idx inGroup:@"Group"];
+ MCONNTPFetchArticleOperation * op = [session fetchMessageOperationWithIndex:idx inGroup:@"Group"];
[op start:^(NSError * error, NSData * messageData) {
// messageData is the RFC 822 formatted message data.
}];
*/
-- (MCONNTPFetchMessageOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group;
+- (MCONNTPFetchArticleOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group;
/**
Returns an operation that will list all available newsgroups.
diff --git a/src/objc/nntp/MCONNTPSession.mm b/src/objc/nntp/MCONNTPSession.mm
index eb7ce4ab..e661eb65 100644
--- a/src/objc/nntp/MCONNTPSession.mm
+++ b/src/objc/nntp/MCONNTPSession.mm
@@ -13,7 +13,7 @@
#import "MCOUtils.h"
#import "MCONNTPOperation.h"
#import "MCOOperation+Private.h"
-#import "MCONNTPFetchMessagesOperation.h"
+#import "MCONNTPFetchArticlesOperation.h"
#import "MCONNTPOperation+Private.h"
using namespace mailcore;
@@ -121,21 +121,21 @@ MCO_OBJC_SYNTHESIZE_SCALAR(dispatch_queue_t, dispatch_queue_t, setDispatchQueue,
return result;
}
-- (MCONNTPFetchMessagesOperation *) fetchMessagesOperation:(NSString *)group
+- (MCONNTPFetchArticlesOperation *) fetchArticlesOperation:(NSString *)group
{
- mailcore::NNTPFetchMessagesOperation * coreOp = MCO_NATIVE_INSTANCE->fetchMessagesOperation(MCO_FROM_OBJC(mailcore::String, group));
+ mailcore::MCNNTPFetchArticlesOperation * coreOp = MCO_NATIVE_INSTANCE->fetchArticlesOperation(MCO_FROM_OBJC(mailcore::String, group));
return MCO_TO_OBJC_OP(coreOp);
}
-- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index
+- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index inGroup:(NSString *)group
{
- mailcore::NNTPFetchHeaderOperation * coreOp = MCO_NATIVE_INSTANCE->fetchHeaderOperation(index);
+ mailcore::NNTPFetchHeaderOperation * coreOp = MCO_NATIVE_INSTANCE->fetchHeaderOperation(MCO_FROM_OBJC(mailcore::String, group), index);
return MCO_TO_OBJC_OP(coreOp);
}
-- (MCONNTPFetchMessageOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group
+- (MCONNTPFetchArticleOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group
{
- mailcore::NNTPFetchMessageOperation * coreOp = MCO_NATIVE_INSTANCE->fetchArticleOperation(MCO_FROM_OBJC(mailcore::String, group), index);
+ mailcore::NNTPFetchArticleOperation * coreOp = MCO_NATIVE_INSTANCE->fetchArticleOperation(MCO_FROM_OBJC(mailcore::String, group), index);
return MCO_TO_OBJC_OP(coreOp);
}