Clean up codebase.

This commit is contained in:
Matthew Chen 2018-03-01 23:30:28 -05:00
parent c2f092018c
commit 59c745756a
13 changed files with 30 additions and 19 deletions

View File

@ -714,7 +714,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Presentation
- (void)presentFromViewController:(UIViewController *)viewController replacingView:(UIView *)view;
- (void)presentFromViewController:(UIViewController *)viewController replacingView:(UIView *)view
{
self.replacingView = view;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self];

View File

@ -147,7 +147,7 @@ NS_ASSUME_NONNULL_BEGIN
[UIApplication.sharedApplication endBackgroundTask:backgroundTaskIdentifier];
}
- (void)ensureSleepBlocking:(BOOL)shouldBeBlocking blockingObjects:(NSArray<id> *)blockingObjects;
- (void)ensureSleepBlocking:(BOOL)shouldBeBlocking blockingObjects:(NSArray<id> *)blockingObjects
{
if (UIApplication.sharedApplication.isIdleTimerDisabled != shouldBeBlocking) {
if (shouldBeBlocking) {

View File

@ -38,7 +38,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
@implementation SharingThreadPickerViewController
- (instancetype)initWithShareViewDelegate:(id<ShareViewDelegate>)shareViewDelegate;
- (instancetype)initWithShareViewDelegate:(id<ShareViewDelegate>)shareViewDelegate
{
self = [super init];
if (!self) {

View File

@ -223,7 +223,7 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification
});
}
- (void)buildSignalAccountsAndClearStaleCache:(BOOL)shouldClearStaleCache;
- (void)buildSignalAccountsAndClearStaleCache:(BOOL)shouldClearStaleCache
{
dispatch_async(self.serialQueue, ^{
NSMutableArray<SignalAccount *> *signalAccounts = [NSMutableArray new];

View File

@ -710,7 +710,7 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
}];
}
- (void)setProfileKeyData:(NSData *)profileKeyData forRecipientId:(NSString *)recipientId;
- (void)setProfileKeyData:(NSData *)profileKeyData forRecipientId:(NSString *)recipientId
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
OWSAES256Key *_Nullable profileKey = [OWSAES256Key keyWithData:profileKeyData];
@ -895,7 +895,7 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
- (void)updateProfileForRecipientId:(NSString *)recipientId
profileNameEncrypted:(nullable NSData *)profileNameEncrypted
avatarUrlPath:(nullable NSString *)avatarUrlPath;
avatarUrlPath:(nullable NSString *)avatarUrlPath
{
OWSAssert(recipientId.length > 0);

View File

@ -262,7 +262,7 @@ NSString *const kLocalProfileUniqueId = @"kLocalProfileUniqueId";
- (void)clearWithProfileKey:(OWSAES256Key *)profileKey
dbConnection:(YapDatabaseConnection *)dbConnection
completion:(nullable OWSUserProfileCompletion)completion;
completion:(nullable OWSUserProfileCompletion)completion
{
[self applyChanges:^(OWSUserProfile *userProfile) {
[userProfile setProfileKey:profileKey];
@ -279,7 +279,7 @@ NSString *const kLocalProfileUniqueId = @"kLocalProfileUniqueId";
- (void)updateWithProfileKey:(OWSAES256Key *)profileKey
dbConnection:(YapDatabaseConnection *)dbConnection
completion:(nullable OWSUserProfileCompletion)completion;
completion:(nullable OWSUserProfileCompletion)completion
{
OWSAssert(profileKey);

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSLinkedDeviceReadReceipt.h"
@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSLinkedDeviceReadReceipt
- (instancetype)initWithSenderId:(NSString *)senderId timestamp:(uint64_t)timestamp;
- (instancetype)initWithSenderId:(NSString *)senderId timestamp:(uint64_t)timestamp
{
OWSAssert(senderId.length > 0 && timestamp > 0);

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSReadReceiptsForSenderMessage.h"
@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSReadReceiptsForSenderMessage
- (instancetype)initWithThread:(nullable TSThread *)thread messageTimestamps:(NSArray<NSNumber *> *)messageTimestamps;
- (instancetype)initWithThread:(nullable TSThread *)thread messageTimestamps:(NSArray<NSNumber *> *)messageTimestamps
{
self = [super initWithTimestamp:[NSDate ows_millisecondTimeStamp] inThread:thread];
if (!self) {

View File

@ -1,9 +1,10 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
#import "Cryptography.h"
#import "NSDate+OWS.h"
#import "OWSSignalServiceProtos.pb.h"
#import "ProtoBuf+OWS.h"
@ -11,6 +12,16 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSOutgoingSyncMessage
- (instancetype)init
{
self = [super initWithTimestamp:[NSDate ows_millisecondTimeStamp]];
if (!self) {
return self;
}
return self;
}
- (BOOL)shouldBeSaved
{
return NO;

View File

@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSRequestFactory
+ (TSRequest *)enable2FARequestWithPin:(NSString *)pin;
+ (TSRequest *)enable2FARequestWithPin:(NSString *)pin
{
OWSAssert(pin.length > 0);
@ -212,8 +212,8 @@ NS_ASSUME_NONNULL_BEGIN
relay:(nullable NSString *)relay
timeStamp:(uint64_t)timeStamp
{
// NOTE: messages may be empty; See comments in OWSDeviceManager.
OWSAssert(recipientId.length > 0);
OWSAssert(messages.count > 0);
OWSAssert(timeStamp > 0);
NSString *path = [textSecureMessagesAPI stringByAppendingString:recipientId];

View File

@ -101,7 +101,7 @@ NSString *const TSStorageManagerKeyPrekeyCurrentSignedPrekeyId = @"currentSigned
#pragma mark - Prekey update failures
- (int)prekeyUpdateFailureCount;
- (int)prekeyUpdateFailureCount
{
NSNumber *value = [self.dbReadConnection objectForKey:TSStorageManagerKeyPrekeyUpdateFailureCount
inCollection:TSStorageManagerSignedPreKeyMetadataCollection];

View File

@ -303,7 +303,7 @@ const NSUInteger kAES256_KeyByteLength = 32;
withKey:(NSData *)key
digest:(nullable NSData *)digest
unpaddedSize:(UInt32)unpaddedSize
error:(NSError **)error;
error:(NSError **)error
{
if (digest.length <= 0) {
// This *could* happen with sufficiently outdated clients.

View File

@ -256,7 +256,7 @@ NS_ASSUME_NONNULL_BEGIN
}
}
+ (nullable DataSource *)dataSourceWithURL:(NSURL *)fileUrl;
+ (nullable DataSource *)dataSourceWithURL:(NSURL *)fileUrl
{
OWSAssert(fileUrl);
@ -268,7 +268,7 @@ NS_ASSUME_NONNULL_BEGIN
return instance;
}
+ (nullable DataSource *)dataSourceWithFilePath:(NSString *)filePath;
+ (nullable DataSource *)dataSourceWithFilePath:(NSString *)filePath
{
OWSAssert(filePath);