diff options
author | 2014-08-17 11:48:31 -0600 | |
---|---|---|
committer | 2014-08-17 11:48:31 -0600 | |
commit | 74afdabf89dbe93aceb88a517eab3270312e1e63 (patch) | |
tree | 59597cda1bda60773005b03f43bef85cd5b7502d /src | |
parent | e0cf9bdd572cc76e3a55eb4cd68defd9a08f83fc (diff) |
Remove ArticleInfo
Diffstat (limited to 'src')
-rw-r--r-- | src/async/nntp/MCNNTPAsyncSession.cc | 11 | ||||
-rw-r--r-- | src/async/nntp/MCNNTPAsyncSession.h | 3 | ||||
-rw-r--r-- | src/async/nntp/MCNNTPFetchArticleOperation.h | 4 | ||||
-rw-r--r-- | src/async/nntp/MCNNTPFetchArticlesOperation.cc | 12 | ||||
-rw-r--r-- | src/async/nntp/MCNNTPFetchArticlesOperation.h | 8 | ||||
-rw-r--r-- | src/cmake/core.cmake | 1 | ||||
-rw-r--r-- | src/cmake/objc.cmake | 1 | ||||
-rw-r--r-- | src/cmake/public-headers.cmake | 1 | ||||
-rw-r--r-- | src/core/nntp/MCNNTP.h | 1 | ||||
-rw-r--r-- | src/core/nntp/MCNNTPArticleInfo.cc | 78 | ||||
-rw-r--r-- | src/core/nntp/MCNNTPArticleInfo.h | 42 | ||||
-rw-r--r-- | src/core/nntp/MCNNTPSession.cc | 20 | ||||
-rw-r--r-- | src/core/nntp/MCNNTPSession.h | 7 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTP.h | 1 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPArticleInfo.h | 31 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPArticleInfo.mm | 71 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPFetchArticleOperation.h | 4 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPFetchArticlesOperation.h | 11 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPFetchArticlesOperation.mm | 6 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPSession.h | 10 |
20 files changed, 32 insertions, 291 deletions
diff --git a/src/async/nntp/MCNNTPAsyncSession.cc b/src/async/nntp/MCNNTPAsyncSession.cc index fec7b31b..833bf4d5 100644 --- a/src/async/nntp/MCNNTPAsyncSession.cc +++ b/src/async/nntp/MCNNTPAsyncSession.cc @@ -172,11 +172,6 @@ NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(String * group return op; } -NNTPFetchHeaderOperation * NNTPAsyncSession::fetchHeaderOperation(String * groupName, NNTPArticleInfo * msg) -{ - return fetchHeaderOperation(groupName, msg->index()); -} - NNTPFetchArticleOperation * NNTPAsyncSession::fetchArticleOperation(String * groupName, unsigned int index) { NNTPFetchArticleOperation * op = new NNTPFetchArticleOperation(); @@ -187,12 +182,6 @@ NNTPFetchArticleOperation * NNTPAsyncSession::fetchArticleOperation(String * gro return op; } -NNTPFetchArticleOperation * NNTPAsyncSession::fetchArticleOperation(String *groupName, NNTPArticleInfo * msg) -{ - return fetchArticleOperation(groupName, msg->index()); -} - - NNTPListNewsgroupsOperation * NNTPAsyncSession::listAllNewsgroupsOperation() { NNTPListNewsgroupsOperation * op = new NNTPListNewsgroupsOperation(); diff --git a/src/async/nntp/MCNNTPAsyncSession.h b/src/async/nntp/MCNNTPAsyncSession.h index 90557326..66f0cc0d 100644 --- a/src/async/nntp/MCNNTPAsyncSession.h +++ b/src/async/nntp/MCNNTPAsyncSession.h @@ -9,7 +9,6 @@ namespace mailcore { class NNTPOperation; - class NNTPArticleInfo; class NNTPSession; class NNTPFetchHeaderOperation; class NNTPFetchArticleOperation; @@ -55,10 +54,8 @@ namespace mailcore { virtual MCNNTPFetchArticlesOperation * fetchArticlesOperation(String * group); virtual NNTPFetchHeaderOperation * fetchHeaderOperation(String * groupName, unsigned int index); - virtual NNTPFetchHeaderOperation * fetchHeaderOperation(String * groupName, NNTPArticleInfo * msg); virtual NNTPFetchArticleOperation * fetchArticleOperation(String *groupName, unsigned int index); - virtual NNTPFetchArticleOperation * fetchArticleOperation(String *groupName, NNTPArticleInfo * msg); virtual NNTPListNewsgroupsOperation * listAllNewsgroupsOperation(); virtual NNTPListNewsgroupsOperation * listSubscribedNewsgroupsOperation(); diff --git a/src/async/nntp/MCNNTPFetchArticleOperation.h b/src/async/nntp/MCNNTPFetchArticleOperation.h index f43799a9..4f607c4f 100644 --- a/src/async/nntp/MCNNTPFetchArticleOperation.h +++ b/src/async/nntp/MCNNTPFetchArticleOperation.h @@ -6,9 +6,9 @@ // Copyright (c) 2014 MailCore. All rights reserved. // -#ifndef MAILCORE_MCNNTPFETCHMESSAGEOPERATION_H +#ifndef MAILCORE_MCNNTPFETCHARTICLEOPERATION_H -#define MAILCORE_MCNNTPFETCHMESSAGEOPERATION_H +#define MAILCORE_MCNNTPFETCHARTICLEOPERATION_H #include <MailCore/MCNNTPOperation.h> diff --git a/src/async/nntp/MCNNTPFetchArticlesOperation.cc b/src/async/nntp/MCNNTPFetchArticlesOperation.cc index 41e3281f..39446f35 100644 --- a/src/async/nntp/MCNNTPFetchArticlesOperation.cc +++ b/src/async/nntp/MCNNTPFetchArticlesOperation.cc @@ -16,13 +16,13 @@ using namespace mailcore; MCNNTPFetchArticlesOperation::MCNNTPFetchArticlesOperation() { mGroupName = NULL; - mMessages = NULL; + mArticles = NULL; } MCNNTPFetchArticlesOperation::~MCNNTPFetchArticlesOperation() { MC_SAFE_RELEASE(mGroupName); - MC_SAFE_RELEASE(mMessages); + MC_SAFE_RELEASE(mArticles); } void MCNNTPFetchArticlesOperation::setGroupName(String * groupname) @@ -35,15 +35,15 @@ String * MCNNTPFetchArticlesOperation::groupName() return mGroupName; } -Array * MCNNTPFetchArticlesOperation::messages() +IndexSet * MCNNTPFetchArticlesOperation::articles() { - return mMessages; + return mArticles; } void MCNNTPFetchArticlesOperation::main() { ErrorCode error; - mMessages = session()->session()->fetchArticles(mGroupName, &error); + mArticles = session()->session()->fetchArticles(mGroupName, &error); setError(error); - MC_SAFE_RETAIN(mMessages); + MC_SAFE_RETAIN(mArticles); } diff --git a/src/async/nntp/MCNNTPFetchArticlesOperation.h b/src/async/nntp/MCNNTPFetchArticlesOperation.h index 28f326ab..fa0037c8 100644 --- a/src/async/nntp/MCNNTPFetchArticlesOperation.h +++ b/src/async/nntp/MCNNTPFetchArticlesOperation.h @@ -6,9 +6,9 @@ // Copyright (c) 2014 MailCore. All rights reserved. // -#ifndef MAILCORE_MCNNTPFETCHMESSAGESOPERATION_H +#ifndef MAILCORE_MCNNTPFETCHARTICLESOPERATION_H -#define MAILCORE_MCNNTPFETCHMESSAGESOPERATION_H +#define MAILCORE_MCNNTPFETCHARTICLESOPERATION_H #include <MailCore/MCNNTPOperation.h> @@ -24,14 +24,14 @@ namespace mailcore { virtual void setGroupName(String * groupName); virtual String * groupName(); - virtual Array * /* NNTPArticleInfo */ messages(); + virtual IndexSet * articles(); public: // subclass behavior virtual void main(); private: String * mGroupName; - Array * /* NNTPArticleInfo */ mMessages; + IndexSet * mArticles; }; } diff --git a/src/cmake/core.cmake b/src/cmake/core.cmake index bf9fb851..e69e4fc0 100644 --- a/src/cmake/core.cmake +++ b/src/cmake/core.cmake @@ -65,7 +65,6 @@ set(pop_files ) set(nntp_files - core/nntp/MCNNTPArticleInfo.cc core/nntp/MCNNTPGroupInfo.cc core/nntp/MCNNTPSession.cc ) diff --git a/src/cmake/objc.cmake b/src/cmake/objc.cmake index fd6c3742..af1cfcf5 100644 --- a/src/cmake/objc.cmake +++ b/src/cmake/objc.cmake @@ -75,7 +75,6 @@ set(objc_smtp_files ) set(objc_nntp_files - objc/nntp/MCONNTPArticleInfo.mm objc/nntp/MCONNTPDisconnectOperation.mm objc/nntp/MCONNTPFetchArticleOperation.mm objc/nntp/MCONNTPFetchArticlesOperation.mm diff --git a/src/cmake/public-headers.cmake b/src/cmake/public-headers.cmake index cfde051e..9361e434 100644 --- a/src/cmake/public-headers.cmake +++ b/src/cmake/public-headers.cmake @@ -185,7 +185,6 @@ objc/smtp/MCOSMTPSession.h objc/smtp/MCOSMTPSendOperation.h objc/smtp/MCOSMTPOperation.h objc/nntp/MCONNTP.h -objc/nntp/MCONNTPArticleInfo.h objc/nntp/MCONNTPDisconnectOperation.h objc/nntp/MCONNTPFetchArticleOperation.h objc/nntp/MCONNTPFetchArticleOperation.mm diff --git a/src/core/nntp/MCNNTP.h b/src/core/nntp/MCNNTP.h index dd18a961..c2da3a66 100644 --- a/src/core/nntp/MCNNTP.h +++ b/src/core/nntp/MCNNTP.h @@ -3,7 +3,6 @@ #define MAILCORE_MCNNTP_H #include <MailCore/MCNNTPGroupInfo.h> -#include <MailCore/MCNNTPArticleInfo.h> #include <MailCore/MCNNTPProgressCallback.h> #include <MailCore/MCNNTPSession.h> diff --git a/src/core/nntp/MCNNTPArticleInfo.cc b/src/core/nntp/MCNNTPArticleInfo.cc deleted file mode 100644 index e3f05998..00000000 --- a/src/core/nntp/MCNNTPArticleInfo.cc +++ /dev/null @@ -1,78 +0,0 @@ -// -// MCNNTPArticleInfo.cpp -// mailcore2 -// -// Created by Robert Widmann on 3/6/14. -// Copyright (c) 2014 MailCore. All rights reserved. -// - -#include "MCNNTPArticleInfo.h" - -using namespace mailcore; - - -void NNTPArticleInfo::init() -{ - mIndex = 0; - mSize = 0; - mUid = NULL; -} - -NNTPArticleInfo::NNTPArticleInfo() -{ - init(); -} - -NNTPArticleInfo::NNTPArticleInfo(NNTPArticleInfo * other) -{ - init(); - mIndex = other->mIndex; - mSize = other->mSize; - MC_SAFE_REPLACE_COPY(String, mUid, other->mUid); -} - -NNTPArticleInfo::~NNTPArticleInfo() -{ - MC_SAFE_RELEASE(mUid); -} - -String * NNTPArticleInfo::description() -{ - return String::stringWithUTF8Format("<%s:%p %u %s %u>", - MCUTF8(className()), this, mIndex, MCUTF8(mUid), mSize); -} - -Object * NNTPArticleInfo::copy() -{ - return new NNTPArticleInfo(this); -} - -void NNTPArticleInfo::setIndex(unsigned int index) -{ - mIndex = index; -} - -unsigned int NNTPArticleInfo::index() -{ - return mIndex; -} - -void NNTPArticleInfo::setSize(unsigned int size) -{ - mSize = size; -} - -unsigned int NNTPArticleInfo::size() -{ - return mSize; -} - -void NNTPArticleInfo::setUid(String * uid) -{ - MC_SAFE_REPLACE_COPY(String, mUid, uid); -} - -String * NNTPArticleInfo::uid() -{ - return mUid; -} diff --git a/src/core/nntp/MCNNTPArticleInfo.h b/src/core/nntp/MCNNTPArticleInfo.h deleted file mode 100644 index 7fa90e19..00000000 --- a/src/core/nntp/MCNNTPArticleInfo.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef MAILCORE_MCNNTPARTICLEINFO_H - -#define MAILCORE_MCNNTPARTICLEINFO_H - -#include <MailCore/MCBaseTypes.h> - -#ifdef __cplusplus - -namespace mailcore { - - class NNTPArticleInfo : public Object { - public: - NNTPArticleInfo(); - virtual ~NNTPArticleInfo(); - - virtual void setIndex(unsigned int index); - virtual unsigned int index(); - - virtual void setSize(unsigned int size); - virtual unsigned int size(); - - virtual void setUid(String * uid); - virtual String * uid(); - - public: // subclass behavior - NNTPArticleInfo(NNTPArticleInfo * other); - virtual String * description(); - virtual Object * copy(); - - private: - unsigned int mIndex; - unsigned int mSize; - String * mUid; - - void init(); - }; - -} - -#endif - -#endif diff --git a/src/core/nntp/MCNNTPSession.cc b/src/core/nntp/MCNNTPSession.cc index d8cf2632..02db197e 100644 --- a/src/core/nntp/MCNNTPSession.cc +++ b/src/core/nntp/MCNNTPSession.cc @@ -11,7 +11,6 @@ #include <string.h> #include <libetpan/libetpan.h> -#include "MCNNTPArticleInfo.h" #include "MCNNTPGroupInfo.h" #include "MCMessageHeader.h" #include "MCConnectionLoggerUtils.h" @@ -431,11 +430,6 @@ MessageHeader * NNTPSession::fetchHeader(String *groupName, unsigned int index, return result; } -MessageHeader * NNTPSession::fetchHeader(String *groupName, NNTPArticleInfo * msg, ErrorCode * pError) -{ - return fetchHeader(groupName, msg->index(), pError); -} - Data * NNTPSession::fetchArticle(String *groupName, unsigned int index, NNTPProgressCallback * callback, ErrorCode * pError) { int r; @@ -472,12 +466,7 @@ Data * NNTPSession::fetchArticle(String *groupName, unsigned int index, NNTPProg return result; } -Data * NNTPSession::fetchArticle(String *groupName, NNTPArticleInfo * msg, NNTPProgressCallback * callback, ErrorCode * pError) -{ - return fetchArticle(groupName, msg->index(), callback, pError); -} - -Array * NNTPSession::fetchArticles(String * groupName, ErrorCode * pError) +IndexSet * NNTPSession::fetchArticles(String * groupName, ErrorCode * pError) { int r; clist * msg_list; @@ -497,7 +486,7 @@ Array * NNTPSession::fetchArticles(String * groupName, ErrorCode * pError) return NULL; } - Array * result = Array::array(); + IndexSet * result = new IndexSet(); clistiter * iter; for(iter = clist_begin(msg_list) ;iter != NULL ; iter = clist_next(iter)) { uint32_t *msg_info; @@ -507,10 +496,7 @@ Array * NNTPSession::fetchArticles(String * groupName, ErrorCode * pError) continue; } - NNTPArticleInfo * info = new NNTPArticleInfo(); - info->setIndex(*msg_info); - result->addObject(info); - info->release(); + result->addIndex(*msg_info); } newsnntp_listgroup_free(msg_list); diff --git a/src/core/nntp/MCNNTPSession.h b/src/core/nntp/MCNNTPSession.h index bdeb3bc1..a6fb511c 100644 --- a/src/core/nntp/MCNNTPSession.h +++ b/src/core/nntp/MCNNTPSession.h @@ -8,7 +8,6 @@ namespace mailcore { - class NNTPArticleInfo; class NNTPProgressCallback; class MessageHeader; @@ -49,12 +48,10 @@ namespace mailcore { virtual Array * listSubscribedNewsgroups(ErrorCode * pError); virtual MessageHeader * fetchHeader(String *groupName, unsigned int index, ErrorCode * pError); - virtual MessageHeader * fetchHeader(String *groupName, NNTPArticleInfo * msg, ErrorCode * pError); - - virtual Array * /* NNTPArticleInfo */ fetchArticles(String * groupname, ErrorCode * pError); + + virtual IndexSet * fetchArticles(String * groupname, ErrorCode * pError); Data * fetchArticle(String *groupName, unsigned int index, NNTPProgressCallback * callback, ErrorCode * pError); - Data * fetchArticle(String *groupName, NNTPArticleInfo * msg, NNTPProgressCallback * callback, ErrorCode * pError); virtual void setConnectionLogger(ConnectionLogger * logger); virtual ConnectionLogger * connectionLogger(); diff --git a/src/objc/nntp/MCONNTP.h b/src/objc/nntp/MCONNTP.h index a1328166..980d0c39 100644 --- a/src/objc/nntp/MCONNTP.h +++ b/src/objc/nntp/MCONNTP.h @@ -16,7 +16,6 @@ #include <MailCore/MCONNTPFetchArticleOperation.h> #include <MailCore/MCONNTPFetchArticlesOperation.h> #include <MailCore/MCONNTPListNewsgroupsOperation.h> -#include <MailCore/MCONNTPArticleInfo.h> #include <MailCore/MCONNTPGroupInfo.h> #endif diff --git a/src/objc/nntp/MCONNTPArticleInfo.h b/src/objc/nntp/MCONNTPArticleInfo.h deleted file mode 100644 index 5e2a6887..00000000 --- a/src/objc/nntp/MCONNTPArticleInfo.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// MCONNTPArticleInfo.h -// mailcore2 -// -// Created by Robert Widmann on 8/13/14. -// Copyright (c) 2014 MailCore. All rights reserved. -// - -#ifndef MAILCORE_MCONNTPARTICLEINFO_H - -#define MAILCORE_MCONNTPARTICLEINFO_H - -#import <Foundation/Foundation.h> - -/** This is information of a message fetched by MCONNTPFetchArticlesOperation.*/ - -@interface MCONNTPArticleInfo : NSObject <NSCopying> - -/** This is the index of a given message.*/ -@property (nonatomic, assign) unsigned int index; - -/** This is the size of the given message.*/ -@property (nonatomic, assign) unsigned int size; - -/** This is the unique identifier of the message. - It can be used as a cache identifier.*/ -@property (nonatomic, copy) NSString * uid; - -@end - -#endif diff --git a/src/objc/nntp/MCONNTPArticleInfo.mm b/src/objc/nntp/MCONNTPArticleInfo.mm deleted file mode 100644 index 61f226f8..00000000 --- a/src/objc/nntp/MCONNTPArticleInfo.mm +++ /dev/null @@ -1,71 +0,0 @@ -// -// MCONNTPArticleInfo.m -// mailcore2 -// -// Created by Robert Widmann on 8/13/14. -// Copyright (c) 2014 MailCore. All rights reserved. -// - -#import "MCONNTPArticleInfo.h" - -#include "MCAsyncNNTP.h" -#include "MCNNTP.h" - -#import "MCOUtils.h" - -@implementation MCONNTPArticleInfo { - mailcore::NNTPArticleInfo * _nativeInfo; -} - -#define nativeType mailcore::NNTPArticleInfo - -+ (void) load -{ - MCORegisterClass(self, &typeid(nativeType)); -} - -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - -+ (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object -{ - mailcore::NNTPArticleInfo * folder = (mailcore::NNTPArticleInfo *) object; - return [[[self alloc] initWithMCNNTPArticleInfo:folder] autorelease]; -} - -- (mailcore::Object *) mco_mcObject -{ - return _nativeInfo; -} - -- (NSString *) description -{ - return MCO_OBJC_BRIDGE_GET(description); -} - -- (id) initWithMCNNTPArticleInfo:(mailcore::NNTPArticleInfo *)info -{ - self = [super init]; - - _nativeInfo = info; - _nativeInfo->retain(); - - return self; -} - -- (void) dealloc -{ - MC_SAFE_RELEASE(_nativeInfo); - [super dealloc]; -} - -MCO_OBJC_SYNTHESIZE_SCALAR(unsigned int, unsigned int, setIndex, index) -MCO_OBJC_SYNTHESIZE_SCALAR(unsigned int, unsigned int, setSize, size) -MCO_OBJC_SYNTHESIZE_STRING(setUid, uid) - -@end diff --git a/src/objc/nntp/MCONNTPFetchArticleOperation.h b/src/objc/nntp/MCONNTPFetchArticleOperation.h index c72351d9..b8bffcb0 100644 --- a/src/objc/nntp/MCONNTPFetchArticleOperation.h +++ b/src/objc/nntp/MCONNTPFetchArticleOperation.h @@ -6,9 +6,9 @@ // Copyright (c) 2014 MailCore. All rights reserved. // -#ifndef MAILCORE_MCONNTPFETCHMESSAGEOPERATION_H +#ifndef MAILCORE_MCONNTPFETCHARTICLEOPERATION_H -#define MAILCORE_MCONNTPFETCHMESSAGEOPERATION_H +#define MAILCORE_MCONNTPFETCHARTICLEOPERATION_H #import <Foundation/Foundation.h> #import <MailCore/MCONNTPOperation.h> diff --git a/src/objc/nntp/MCONNTPFetchArticlesOperation.h b/src/objc/nntp/MCONNTPFetchArticlesOperation.h index 6d2a9dab..35a0889d 100644 --- a/src/objc/nntp/MCONNTPFetchArticlesOperation.h +++ b/src/objc/nntp/MCONNTPFetchArticlesOperation.h @@ -6,15 +6,16 @@ // Copyright (c) 2014 MailCore. All rights reserved. // -#ifndef MAILCORE_MCONNTPFETCHMESSAGESOPERATION_H +#ifndef MAILCORE_MCONNTPFETCHARTICLESOPERATION_H -#define MAILCORE_MCONNTPFETCHMESSAGESOPERATION_H +#define MAILCORE_MCONNTPFETCHARTICLESOPERATION_H #import <Foundation/Foundation.h> #import <MailCore/MCONNTPOperation.h> -/** This is an asynchronous operation that will fetch the list of a messages on the NNTP3 account. */ +@class MCOIndexSet; +/** This is an asynchronous operation that will fetch the list of a messages on the NNTP server. */ @interface MCONNTPFetchArticlesOperation : MCONNTPOperation /** @@ -22,12 +23,12 @@ @param completionBlock Called when the operation is finished. - - On success `error` will be nil and `messages` will be an array of MCONNTPArticleInfo + - On success `error` will be nil and `articles` will be an index set of article numbers. - On failure, `error` will be set with `MCOErrorDomain` as domain and an error code available in MCOConstants.h, `messages` will be null */ -- (void) start:(void (^)(NSError * error, NSArray * /* MCONNTPArticleInfo */ messages))completionBlock; +- (void) start:(void (^)(NSError * error, MCOIndexSet * articles))completionBlock; @end diff --git a/src/objc/nntp/MCONNTPFetchArticlesOperation.mm b/src/objc/nntp/MCONNTPFetchArticlesOperation.mm index b7c4670e..6e13a5d2 100644 --- a/src/objc/nntp/MCONNTPFetchArticlesOperation.mm +++ b/src/objc/nntp/MCONNTPFetchArticlesOperation.mm @@ -13,7 +13,7 @@ #import "MCOOperation+Private.h" #import "MCOUtils.h" -typedef void (^CompletionType)(NSError *error, NSArray * messages); +typedef void (^CompletionType)(NSError *error, MCOIndexSet * articles); @implementation MCONNTPFetchArticlesOperation { CompletionType _completionBlock; @@ -38,7 +38,7 @@ typedef void (^CompletionType)(NSError *error, NSArray * messages); [super dealloc]; } -- (void) start:(void (^)(NSError *error, NSArray * messages))completionBlock +- (void) start:(void (^)(NSError *error, MCOIndexSet * articles))completionBlock { _completionBlock = [completionBlock copy]; [self start]; @@ -58,7 +58,7 @@ typedef void (^CompletionType)(NSError *error, NSArray * messages); nativeType *op = MCO_NATIVE_INSTANCE; if (op->error() == mailcore::ErrorNone) { - _completionBlock(nil, MCO_TO_OBJC(op->messages())); + _completionBlock(nil, MCO_TO_OBJC(op->articles())); } else { _completionBlock([NSError mco_errorWithErrorCode:op->error()], nil); } diff --git a/src/objc/nntp/MCONNTPSession.h b/src/objc/nntp/MCONNTPSession.h index 89795087..6712d9e4 100644 --- a/src/objc/nntp/MCONNTPSession.h +++ b/src/objc/nntp/MCONNTPSession.h @@ -66,12 +66,10 @@ /** @name Operations */ /** - Returns an operation that will fetch the list of messages. + Returns an operation that will fetch the list of article numbers. - MCONNTPFetchArticlesOperation * op = [session fetchMessagesOperation]; - [op start:^(NSError * error, NSArray * messages) { - // messages is an array of MCONNTPArticleInfo - // [info index] can be used as reference for a given message in the other operations. + MCONNTPFetchArticlesOperation * op = [session fetchArticlesOperation]; + [op start:^(NSError * error, MCOIndexSet * articles) { }]; */ - (MCONNTPFetchArticlesOperation *) fetchArticlesOperation:(NSString *)group; @@ -89,7 +87,7 @@ /** Returns an operation that will fetch the content of the given message. - MCONNTPFetchArticleOperation * op = [session fetchMessageOperationWithIndex:idx inGroup:@"Group"]; + MCONNTPFetchArticleOperation * op = [session fetchArticleOperationWithIndex:idx inGroup:@"Group"]; [op start:^(NSError * error, NSData * messageData) { // messageData is the RFC 822 formatted message data. }]; |