diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2016-04-01 21:58:49 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2016-04-01 21:59:00 -0700 |
commit | 36d342d911e0cf2cad6a008ecc9b5ce401c9029e (patch) | |
tree | c5dbf0c87e0212a0da08c8480c7682e8a39ed63c /src/objc | |
parent | 811b8ac5057f0c77e3db388088c61e0763282fd9 (diff) |
Move string to constant
Diffstat (limited to 'src/objc')
-rw-r--r-- | src/objc/abstract/MCOConstants.h | 3 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPCheckAccountOperation.mm | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/objc/abstract/MCOConstants.h b/src/objc/abstract/MCOConstants.h index 1809e30c..cc422ed9 100644 --- a/src/objc/abstract/MCOConstants.h +++ b/src/objc/abstract/MCOConstants.h @@ -452,4 +452,7 @@ typedef void (^MCOConnectionLogger)(void * connectionID, MCOConnectionLogType ty */ typedef void (^MCOOperationQueueRunningChangeBlock)(void); +/** MCOIMAPResponseKey is a key for NSError userInfo dictionary, the value is string with the server response. */ +#define MCOIMAPResponseKey @"MCOIMAPResponseKey" + #endif diff --git a/src/objc/imap/MCOIMAPCheckAccountOperation.mm b/src/objc/imap/MCOIMAPCheckAccountOperation.mm index 42472431..8117df2e 100644 --- a/src/objc/imap/MCOIMAPCheckAccountOperation.mm +++ b/src/objc/imap/MCOIMAPCheckAccountOperation.mm @@ -12,6 +12,7 @@ #import "MCOOperation+Private.h" #import "MCOUtils.h" +#import "MCOConstants.h" typedef void (^CompletionType)(NSError *error); @@ -63,7 +64,7 @@ typedef void (^CompletionType)(NSError *error); NSError * error = [NSError mco_errorWithErrorCode:op->error()]; if (op->loginResponse() != NULL) { NSMutableDictionary * userInfo = [[error userInfo] mutableCopy]; - userInfo[@"IMAPServerError"] = MCO_TO_OBJC(op->loginResponse()); + userInfo[MCOIMAPResponseKey] = MCO_TO_OBJC(op->loginResponse()); error = [NSError errorWithDomain:[error domain] code:[error code] userInfo:userInfo]; } _completionBlock(error); |