diff options
-rwxr-xr-x | build-mac/mailcore2.xcodeproj/project.pbxproj | 24 | ||||
-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 |
21 files changed, 32 insertions, 315 deletions
diff --git a/build-mac/mailcore2.xcodeproj/project.pbxproj b/build-mac/mailcore2.xcodeproj/project.pbxproj index 87a95b2c..e4551bae 100755 --- a/build-mac/mailcore2.xcodeproj/project.pbxproj +++ b/build-mac/mailcore2.xcodeproj/project.pbxproj @@ -30,8 +30,6 @@ 849189A218C93FB7002063A3 /* MCNNTPSession.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8491899F18C93FB7002063A3 /* MCNNTPSession.cc */; }; 849189A318C94023002063A3 /* MCNNTP.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8491899C18C93F92002063A3 /* MCNNTP.h */; }; 849189A418C94023002063A3 /* MCNNTPSession.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 849189A018C93FB7002063A3 /* MCNNTPSession.h */; }; - 849189A718C9477F002063A3 /* MCNNTPArticleInfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 849189A518C9477F002063A3 /* MCNNTPArticleInfo.cc */; }; - 849189A818C9477F002063A3 /* MCNNTPArticleInfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 849189A518C9477F002063A3 /* MCNNTPArticleInfo.cc */; }; 849189AB18C94986002063A3 /* MCNNTPGroupInfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 849189A918C94986002063A3 /* MCNNTPGroupInfo.cc */; }; 849189AC18C94986002063A3 /* MCNNTPGroupInfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 849189A918C94986002063A3 /* MCNNTPGroupInfo.cc */; }; 849F53D817F28443002D417F /* MCOPOPNoopOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84B639EF17F282B4003B5BA2 /* MCOPOPNoopOperation.h */; }; @@ -97,8 +95,6 @@ 84D73772199C007E005124E5 /* MCONNTPFetchArticleOperation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D73770199C007E005124E5 /* MCONNTPFetchArticleOperation.mm */; }; 84D73775199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D73774199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm */; }; 84D73776199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D73774199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm */; }; - 84D73779199C00C9005124E5 /* MCONNTPArticleInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D73778199C00C9005124E5 /* MCONNTPArticleInfo.mm */; }; - 84D7377A199C00C9005124E5 /* MCONNTPArticleInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D73778199C00C9005124E5 /* MCONNTPArticleInfo.mm */; }; 84D7377B199C00F5005124E5 /* MCONNTP.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73761199BFF80005124E5 /* MCONNTP.h */; }; 84D7377C199C00F7005124E5 /* MCONNTP.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73761199BFF80005124E5 /* MCONNTP.h */; }; 84D7377D199C00FE005124E5 /* MCONNTPSession.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73762199BFFC7005124E5 /* MCONNTPSession.h */; }; @@ -107,20 +103,16 @@ 84D73780199C0107005124E5 /* MCONNTPFetchHeaderOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D7376B199C005A005124E5 /* MCONNTPFetchHeaderOperation.h */; }; 84D73781199C010A005124E5 /* MCONNTPFetchArticleOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D7376F199C007E005124E5 /* MCONNTPFetchArticleOperation.h */; }; 84D73782199C010B005124E5 /* MCONNTPFetchArticlesOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73773199C00AB005124E5 /* MCONNTPFetchArticlesOperation.h */; }; - 84D73783199C010C005124E5 /* MCONNTPArticleInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73777199C00C9005124E5 /* MCONNTPArticleInfo.h */; }; 84D73784199C0114005124E5 /* MCONNTPOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73766199BFFFC005124E5 /* MCONNTPOperation.h */; }; 84D73785199C0117005124E5 /* MCONNTPFetchHeaderOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D7376B199C005A005124E5 /* MCONNTPFetchHeaderOperation.h */; }; 84D73786199C0118005124E5 /* MCONNTPFetchArticleOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D7376F199C007E005124E5 /* MCONNTPFetchArticleOperation.h */; }; 84D73787199C011A005124E5 /* MCONNTPFetchArticlesOperation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73773199C00AB005124E5 /* MCONNTPFetchArticlesOperation.h */; }; - 84D73788199C011C005124E5 /* MCONNTPArticleInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D73777199C00C9005124E5 /* MCONNTPArticleInfo.h */; }; 84D7378B199C0260005124E5 /* MCONNTPListNewsgroupsOperation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D7378A199C0260005124E5 /* MCONNTPListNewsgroupsOperation.mm */; }; 84D7378C199C0260005124E5 /* MCONNTPListNewsgroupsOperation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D7378A199C0260005124E5 /* MCONNTPListNewsgroupsOperation.mm */; }; 84D7378F199C02A8005124E5 /* MCONNTPDisconnectOperation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D7378E199C02A8005124E5 /* MCONNTPDisconnectOperation.mm */; }; 84D73790199C02A8005124E5 /* MCONNTPDisconnectOperation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D7378E199C02A8005124E5 /* MCONNTPDisconnectOperation.mm */; }; 84D73793199C0511005124E5 /* MCONNTPGroupInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D73792199C0511005124E5 /* MCONNTPGroupInfo.mm */; }; 84D73794199C0511005124E5 /* MCONNTPGroupInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84D73792199C0511005124E5 /* MCONNTPGroupInfo.mm */; }; - 84E65531199BE10F00EC8CC4 /* MCNNTPArticleInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 849189A618C9477F002063A3 /* MCNNTPArticleInfo.h */; }; - 84E65532199BE11800EC8CC4 /* MCNNTPArticleInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 849189A618C9477F002063A3 /* MCNNTPArticleInfo.h */; }; 84E65533199BE15500EC8CC4 /* MCNNTPSession.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 849189A018C93FB7002063A3 /* MCNNTPSession.h */; }; 84E65534199BE2BF00EC8CC4 /* MCNNTPGroupInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 849189AA18C94986002063A3 /* MCNNTPGroupInfo.h */; }; 84E65535199BE2C300EC8CC4 /* MCNNTPGroupInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 849189AA18C94986002063A3 /* MCNNTPGroupInfo.h */; }; @@ -873,7 +865,6 @@ files = ( 849189A318C94023002063A3 /* MCNNTP.h in CopyFiles */, 849189A418C94023002063A3 /* MCNNTPSession.h in CopyFiles */, - 84E65531199BE10F00EC8CC4 /* MCNNTPArticleInfo.h in CopyFiles */, 84B639F317F2839C003B5BA2 /* MCOPOPNoopOperation.h in CopyFiles */, 84B639F417F2839C003B5BA2 /* MCIMAPNoopOperation.h in CopyFiles */, 84D7377B199C00F5005124E5 /* MCONNTP.h in CopyFiles */, @@ -942,7 +933,6 @@ C6F61FA0170187B80073032E /* MCOIMAPFolderInfoOperation.h in CopyFiles */, C6F61FA4170187C30073032E /* MCOIMAPFetchMessagesOperation.h in CopyFiles */, 84D73781199C010A005124E5 /* MCONNTPFetchArticleOperation.h in CopyFiles */, - 84D73783199C010C005124E5 /* MCONNTPArticleInfo.h in CopyFiles */, 84D73782199C010B005124E5 /* MCONNTPFetchArticlesOperation.h in CopyFiles */, C6F61FA3170187BD0073032E /* MCOIMAPCopyMessagesOperation.h in CopyFiles */, C6D6F95A171E5D60006F5B28 /* MCJSON.h in CopyFiles */, @@ -1096,7 +1086,6 @@ files = ( 849F53D817F28443002D417F /* MCOPOPNoopOperation.h in CopyFiles */, 849F53D917F28443002D417F /* MCIMAPNoopOperation.h in CopyFiles */, - 84E65532199BE11800EC8CC4 /* MCNNTPArticleInfo.h in CopyFiles */, 849F53DA17F28443002D417F /* MCPOPNoopOperation.h in CopyFiles */, 849F53DB17F28443002D417F /* MCSMTPNoopOperation.h in CopyFiles */, 84915BB8199C4B0400EDDED9 /* MCNNTP.h in CopyFiles */, @@ -1112,7 +1101,6 @@ 84D73787199C011A005124E5 /* MCONNTPFetchArticlesOperation.h in CopyFiles */, 84391344199C3AB200FEFCDD /* MCONNTPDisconnectOperation.h in CopyFiles */, 84391343199C3AAA00FEFCDD /* MCONNTPListNewsgroupsOperation.h in CopyFiles */, - 84D73788199C011C005124E5 /* MCONNTPArticleInfo.h in CopyFiles */, 84D73786199C0118005124E5 /* MCONNTPFetchArticleOperation.h in CopyFiles */, 84391347199C3ABD00FEFCDD /* MCONNTPGroupInfo.h in CopyFiles */, 84D73749199BFACF005124E5 /* MCNNTPAsyncSession.h in CopyFiles */, @@ -1316,8 +1304,6 @@ 8491899C18C93F92002063A3 /* MCNNTP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MCNNTP.h; path = nntp/MCNNTP.h; sourceTree = "<group>"; }; 8491899F18C93FB7002063A3 /* MCNNTPSession.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MCNNTPSession.cc; path = nntp/MCNNTPSession.cc; sourceTree = "<group>"; }; 849189A018C93FB7002063A3 /* MCNNTPSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MCNNTPSession.h; path = nntp/MCNNTPSession.h; sourceTree = "<group>"; }; - 849189A518C9477F002063A3 /* MCNNTPArticleInfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MCNNTPArticleInfo.cc; path = nntp/MCNNTPArticleInfo.cc; sourceTree = "<group>"; }; - 849189A618C9477F002063A3 /* MCNNTPArticleInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MCNNTPArticleInfo.h; path = nntp/MCNNTPArticleInfo.h; sourceTree = "<group>"; }; 849189A918C94986002063A3 /* MCNNTPGroupInfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MCNNTPGroupInfo.cc; path = nntp/MCNNTPGroupInfo.cc; sourceTree = "<group>"; }; 849189AA18C94986002063A3 /* MCNNTPGroupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MCNNTPGroupInfo.h; path = nntp/MCNNTPGroupInfo.h; sourceTree = "<group>"; }; 84AF9E7D172DBAF600E60AA3 /* providers.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = providers.json; path = ../resources/providers.json; sourceTree = "<group>"; }; @@ -1360,8 +1346,6 @@ 84D73770199C007E005124E5 /* MCONNTPFetchArticleOperation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MCONNTPFetchArticleOperation.mm; sourceTree = "<group>"; }; 84D73773199C00AB005124E5 /* MCONNTPFetchArticlesOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCONNTPFetchArticlesOperation.h; sourceTree = "<group>"; }; 84D73774199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MCONNTPFetchArticlesOperation.mm; sourceTree = "<group>"; }; - 84D73777199C00C9005124E5 /* MCONNTPArticleInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCONNTPArticleInfo.h; sourceTree = "<group>"; }; - 84D73778199C00C9005124E5 /* MCONNTPArticleInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MCONNTPArticleInfo.mm; sourceTree = "<group>"; }; 84D73789199C0260005124E5 /* MCONNTPListNewsgroupsOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCONNTPListNewsgroupsOperation.h; sourceTree = "<group>"; }; 84D7378A199C0260005124E5 /* MCONNTPListNewsgroupsOperation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MCONNTPListNewsgroupsOperation.mm; sourceTree = "<group>"; }; 84D7378D199C02A8005124E5 /* MCONNTPDisconnectOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCONNTPDisconnectOperation.h; sourceTree = "<group>"; }; @@ -1843,8 +1827,6 @@ isa = PBXGroup; children = ( 8491899C18C93F92002063A3 /* MCNNTP.h */, - 849189A518C9477F002063A3 /* MCNNTPArticleInfo.cc */, - 849189A618C9477F002063A3 /* MCNNTPArticleInfo.h */, 849189A918C94986002063A3 /* MCNNTPGroupInfo.cc */, 849189AA18C94986002063A3 /* MCNNTPGroupInfo.h */, 84D73732199BF754005124E5 /* MCNNTPProgressCallback.h */, @@ -1926,8 +1908,6 @@ 84D73774199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm */, 84D7378D199C02A8005124E5 /* MCONNTPDisconnectOperation.h */, 84D7378E199C02A8005124E5 /* MCONNTPDisconnectOperation.mm */, - 84D73777199C00C9005124E5 /* MCONNTPArticleInfo.h */, - 84D73778199C00C9005124E5 /* MCONNTPArticleInfo.mm */, 84D73791199C0511005124E5 /* MCONNTPGroupInfo.h */, 84D73792199C0511005124E5 /* MCONNTPGroupInfo.mm */, ); @@ -2833,7 +2813,6 @@ C64EA71D169E847800778456 /* MCOperation.cc in Sources */, C64EA720169E847800778456 /* MCOperationQueue.cc in Sources */, C64EA723169E847800778456 /* MCIMAPFolder.cc in Sources */, - 84D73779199C00C9005124E5 /* MCONNTPArticleInfo.mm in Sources */, C64EA725169E847800778456 /* MCIMAPMessage.cc in Sources */, C64EA727169E847800778456 /* MCIMAPMessagePart.cc in Sources */, 84D73775199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm in Sources */, @@ -2957,7 +2936,6 @@ C6F61F8717016AD60073032E /* MCOIMAPFetchContentOperation.mm in Sources */, C6F61F8A17016AE60073032E /* MCOIMAPSearchOperation.mm in Sources */, C6F61F8D17016AFB0073032E /* MCOIMAPIdleOperation.mm in Sources */, - 849189A718C9477F002063A3 /* MCNNTPArticleInfo.cc in Sources */, C6F61F9017016B0A0073032E /* MCOIMAPFetchNamespaceOperation.mm in Sources */, C6F61F9317016B250073032E /* MCOIMAPIdentityOperation.mm in Sources */, C6F61F9617016B310073032E /* MCOIMAPCapabilityOperation.mm in Sources */, @@ -3059,7 +3037,6 @@ C6BA2BAC1705F4E6003F0E9E /* MCOperation.cc in Sources */, C6BA2BAD1705F4E6003F0E9E /* MCOperationQueue.cc in Sources */, C6BA2BAE1705F4E6003F0E9E /* MCIMAPFolder.cc in Sources */, - 84D7377A199C00C9005124E5 /* MCONNTPArticleInfo.mm in Sources */, C6BA2BAF1705F4E6003F0E9E /* MCIMAPMessage.cc in Sources */, C6BA2BB01705F4E6003F0E9E /* MCIMAPMessagePart.cc in Sources */, 84D73776199C00AB005124E5 /* MCONNTPFetchArticlesOperation.mm in Sources */, @@ -3183,7 +3160,6 @@ C6BA2C0C1705F4E6003F0E9E /* MCOIMAPFetchContentOperation.mm in Sources */, C6BA2C0D1705F4E6003F0E9E /* MCOIMAPSearchOperation.mm in Sources */, C6BA2C0E1705F4E6003F0E9E /* MCOIMAPIdleOperation.mm in Sources */, - 849189A818C9477F002063A3 /* MCNNTPArticleInfo.cc in Sources */, C6BA2C0F1705F4E6003F0E9E /* MCOIMAPFetchNamespaceOperation.mm in Sources */, C6BA2C101705F4E6003F0E9E /* MCOIMAPIdentityOperation.mm in Sources */, C6BA2C111705F4E6003F0E9E /* MCOIMAPCapabilityOperation.mm in Sources */, 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. }]; |