aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Jesse Tipton <jesse@jessetipton.com>2018-09-19 07:20:26 -0700
committerGravatar HoĆ  V. DINH <dinh.viet.hoa@gmail.com>2018-09-19 07:20:26 -0700
commite0d20b41d0eeb0fc1c8d4aaa359a455c9bd42c1b (patch)
treec4226bbeabb31058f566df0e44d1622df9538138 /src
parentc6a21be1688e0ae11fac0602fa5365a443d0c075 (diff)
A few type/nullability annotations (#1782)
Diffstat (limited to 'src')
-rw-r--r--src/objc/imap/MCOIMAPFetchMessagesOperation.h3
-rw-r--r--src/objc/imap/MCOIMAPFetchMessagesOperation.mm2
-rw-r--r--src/objc/provider/MCOMailProvider.h8
-rw-r--r--src/objc/provider/MCOMailProvidersManager.h10
4 files changed, 15 insertions, 8 deletions
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<MCOIMAPMessage *> * __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<MCOIMAPMessage *> * 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 <Foundation/Foundation.h>
+@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<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;
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