From e0d20b41d0eeb0fc1c8d4aaa359a455c9bd42c1b Mon Sep 17 00:00:00 2001 From: Jesse Tipton Date: Wed, 19 Sep 2018 07:20:26 -0700 Subject: A few type/nullability annotations (#1782) --- src/objc/imap/MCOIMAPFetchMessagesOperation.h | 3 ++- src/objc/imap/MCOIMAPFetchMessagesOperation.mm | 2 +- src/objc/provider/MCOMailProvider.h | 8 +++++--- src/objc/provider/MCOMailProvidersManager.h | 10 +++++++--- 4 files changed, 15 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/objc/imap/MCOIMAPFetchMessagesOperation.h b/src/objc/imap/MCOIMAPFetchMessagesOperation.h index ac1506c0..74983166 100644 --- a/src/objc/imap/MCOIMAPFetchMessagesOperation.h +++ b/src/objc/imap/MCOIMAPFetchMessagesOperation.h @@ -15,6 +15,7 @@ /** This class implements an operation to fetch a list of messages from a folder */ +@class MCOIMAPMessage; @class MCOIndexSet; NS_ASSUME_NONNULL_BEGIN @@ -39,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN If you are not supporting QRESYNC you can safely ignore `vanishedMessages`. */ -- (void) start:(void (^)(NSError * __nullable error, NSArray * /* MCOIMAPMessage */ __nullable messages, MCOIndexSet * __nullable vanishedMessages))completionBlock; +- (void) start:(void (^)(NSError * __nullable error, NSArray * __nullable messages, MCOIndexSet * __nullable vanishedMessages))completionBlock; @end NS_ASSUME_NONNULL_END diff --git a/src/objc/imap/MCOIMAPFetchMessagesOperation.mm b/src/objc/imap/MCOIMAPFetchMessagesOperation.mm index 83012ca5..a29a05fb 100644 --- a/src/objc/imap/MCOIMAPFetchMessagesOperation.mm +++ b/src/objc/imap/MCOIMAPFetchMessagesOperation.mm @@ -41,7 +41,7 @@ typedef void (^CompletionType)(NSError *error, NSArray * messages, MCOIndexSet * [super dealloc]; } -- (void) start:(void (^)(NSError *error, NSArray * messages, MCOIndexSet * vanishedMessages))completionBlock +- (void) start:(void (^)(NSError *error, NSArray * messages, MCOIndexSet * vanishedMessages))completionBlock { _completionBlock = [completionBlock copy]; [self start]; diff --git a/src/objc/provider/MCOMailProvider.h b/src/objc/provider/MCOMailProvider.h index 79f00357..e59a352d 100644 --- a/src/objc/provider/MCOMailProvider.h +++ b/src/objc/provider/MCOMailProvider.h @@ -8,6 +8,8 @@ #import +@class MCONetService; + /** Represents a email service provider, like for example Gmail, Yahoo, Fastmail.fm etc. */ @@ -22,19 +24,19 @@ A list of ways that you can connect to the IMAP server @return An array of MCONetService */ -- (NSArray * /* MCONetService */) imapServices; +- (NSArray *) imapServices; /** A list of ways that you can connect to the SMTP server @return An array of MCONetService */ -- (NSArray * /* MCONetService */) smtpServices; +- (NSArray *) smtpServices; /** A list of ways that you can connect to the POP3 server @return An array of MCONetService */ -- (NSArray * /* MCONetService */) popServices; +- (NSArray *) popServices; - (BOOL) matchEmail:(NSString *)email; - (BOOL) matchMX:(NSString *)hostname; diff --git a/src/objc/provider/MCOMailProvidersManager.h b/src/objc/provider/MCOMailProvidersManager.h index 09df25ad..e5d2b9d6 100644 --- a/src/objc/provider/MCOMailProvidersManager.h +++ b/src/objc/provider/MCOMailProvidersManager.h @@ -20,6 +20,8 @@ @interface MCOMailProvidersManager : NSObject +NS_ASSUME_NONNULL_BEGIN + /** The shared manager that is used for all lookups */ + (MCOMailProvidersManager *) sharedManager; @@ -27,20 +29,20 @@ Given an email address will try to determine the provider @return The email provider info or nil if it can't be determined. */ -- (MCOMailProvider *) providerForEmail:(NSString *)email; +- (nullable MCOMailProvider *) providerForEmail:(NSString *)email; /** Given the DNS MX record will try to determine the provider @return The email provider info or nil if it can't be determined. */ -- (MCOMailProvider *) providerForMX:(NSString *)hostname; +- (nullable MCOMailProvider *) providerForMX:(NSString *)hostname; /** Will return information about a provider. Useful if you already know the provider (like if it has been determined previously) @return The email provider info or nil if none matches */ -- (MCOMailProvider *) providerForIdentifier:(NSString *)identifier; +- (nullable MCOMailProvider *) providerForIdentifier:(NSString *)identifier; /** Registers the providers in the JSON file at the file path so they @@ -48,4 +50,6 @@ */ - (void) registerProvidersWithFilename:(NSString *)filename; +NS_ASSUME_NONNULL_END + @end -- cgit v1.2.3