Skip to content

Commit

Permalink
A few type/nullability annotations (#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessetipton authored and dinhvh committed Sep 19, 2018
1 parent c6a21be commit e0d20b4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/objc/imap/MCOIMAPFetchMessagesOperation.h
Expand Up @@ -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
Expand All @@ -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<MCOIMAPMessage *> * __nullable messages, MCOIndexSet * __nullable vanishedMessages))completionBlock;

@end
NS_ASSUME_NONNULL_END
Expand Down
2 changes: 1 addition & 1 deletion src/objc/imap/MCOIMAPFetchMessagesOperation.mm
Expand Up @@ -41,7 +41,7 @@ - (void) dealloc
[super dealloc];
}

- (void) start:(void (^)(NSError *error, NSArray * messages, MCOIndexSet * vanishedMessages))completionBlock
- (void) start:(void (^)(NSError *error, NSArray<MCOIMAPMessage *> * messages, MCOIndexSet * vanishedMessages))completionBlock
{
_completionBlock = [completionBlock copy];
[self start];
Expand Down
8 changes: 5 additions & 3 deletions src/objc/provider/MCOMailProvider.h
Expand Up @@ -8,6 +8,8 @@

#import <Foundation/Foundation.h>

@class MCONetService;

/**
Represents a email service provider, like for example Gmail, Yahoo, Fastmail.fm etc.
*/
Expand All @@ -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<MCONetService *> *) imapServices;

/**
A list of ways that you can connect to the SMTP server
@return An array of MCONetService
*/
- (NSArray * /* MCONetService */) smtpServices;
- (NSArray<MCONetService *> *) smtpServices;

/**
A list of ways that you can connect to the POP3 server
@return An array of MCONetService
*/
- (NSArray * /* MCONetService */) popServices;
- (NSArray<MCONetService *> *) popServices;

- (BOOL) matchEmail:(NSString *)email;
- (BOOL) matchMX:(NSString *)hostname;
Expand Down
10 changes: 7 additions & 3 deletions src/objc/provider/MCOMailProvidersManager.h
Expand Up @@ -20,32 +20,36 @@

@interface MCOMailProvidersManager : NSObject

NS_ASSUME_NONNULL_BEGIN

/** The shared manager that is used for all lookups */
+ (MCOMailProvidersManager *) sharedManager;

/**
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
can be used with MCOMailProvidersManager.
*/
- (void) registerProvidersWithFilename:(NSString *)filename;

NS_ASSUME_NONNULL_END

@end

0 comments on commit e0d20b4

Please sign in to comment.