diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-03-30 19:42:26 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-03-30 19:42:26 -0700 |
commit | 1e5482c0745a77b158ac07e1cc602f9ab2cc0caa (patch) | |
tree | cdcfff5920c926f0f3b681210905aa5ead1e9137 /src/objc/smtp/MCOSMTPOperation.mm | |
parent | c51a8a2b44e6934de9d45d74ddec4b70b00f1abb (diff) |
Implemented ObjC API for SMTP and POP
Diffstat (limited to 'src/objc/smtp/MCOSMTPOperation.mm')
-rw-r--r-- | src/objc/smtp/MCOSMTPOperation.mm | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/objc/smtp/MCOSMTPOperation.mm b/src/objc/smtp/MCOSMTPOperation.mm new file mode 100644 index 00000000..5bd5ab3a --- /dev/null +++ b/src/objc/smtp/MCOSMTPOperation.mm @@ -0,0 +1,40 @@ +// +// MCOSMTPCheckAccountOperation.m +// mailcore2 +// +// Created by DINH Viêt Hoà on 3/29/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#import "MCOSMTPOperation.h" + +#include "MCAsyncSMTP.h" + +#import "MCOUtils.h" +#import "MCOOperation+Private.h" + +typedef void (^CompletionType)(NSError *error); + +@implementation MCOSMTPOperation { + CompletionType _completionBlock; +} + +#define nativeType mailcore::SMTPOperation + +- (void) dealloc +{ + [_completionBlock release]; + [super dealloc]; +} + +- (void)start:(void (^)(NSError *error))completionBlock { + _completionBlock = [completionBlock copy]; + [self start]; +} + +- (void)operationCompleted { + NSError * error = [NSError mco_errorWithErrorCode:MCO_NATIVE_INSTANCE->error()]; + _completionBlock(error); +} + +@end |