diff --git a/Signal/src/ViewControllers/MediaDetailViewController.m b/Signal/src/ViewControllers/MediaDetailViewController.m index 23b8f6d37..4fefc8bcc 100644 --- a/Signal/src/ViewControllers/MediaDetailViewController.m +++ b/Signal/src/ViewControllers/MediaDetailViewController.m @@ -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]; diff --git a/Signal/src/util/MainAppContext.m b/Signal/src/util/MainAppContext.m index 1853fed41..7f59b2ff9 100644 --- a/Signal/src/util/MainAppContext.m +++ b/Signal/src/util/MainAppContext.m @@ -147,7 +147,7 @@ NS_ASSUME_NONNULL_BEGIN [UIApplication.sharedApplication endBackgroundTask:backgroundTaskIdentifier]; } -- (void)ensureSleepBlocking:(BOOL)shouldBeBlocking blockingObjects:(NSArray *)blockingObjects; +- (void)ensureSleepBlocking:(BOOL)shouldBeBlocking blockingObjects:(NSArray *)blockingObjects { if (UIApplication.sharedApplication.isIdleTimerDisabled != shouldBeBlocking) { if (shouldBeBlocking) { diff --git a/SignalMessaging/attachments/SharingThreadPickerViewController.m b/SignalMessaging/attachments/SharingThreadPickerViewController.m index eb45c1419..b30d0a0da 100644 --- a/SignalMessaging/attachments/SharingThreadPickerViewController.m +++ b/SignalMessaging/attachments/SharingThreadPickerViewController.m @@ -38,7 +38,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion); @implementation SharingThreadPickerViewController -- (instancetype)initWithShareViewDelegate:(id)shareViewDelegate; +- (instancetype)initWithShareViewDelegate:(id)shareViewDelegate { self = [super init]; if (!self) { diff --git a/SignalMessaging/contacts/OWSContactsManager.m b/SignalMessaging/contacts/OWSContactsManager.m index 3ca8cc09e..af56b32fa 100644 --- a/SignalMessaging/contacts/OWSContactsManager.m +++ b/SignalMessaging/contacts/OWSContactsManager.m @@ -223,7 +223,7 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification }); } -- (void)buildSignalAccountsAndClearStaleCache:(BOOL)shouldClearStaleCache; +- (void)buildSignalAccountsAndClearStaleCache:(BOOL)shouldClearStaleCache { dispatch_async(self.serialQueue, ^{ NSMutableArray *signalAccounts = [NSMutableArray new]; diff --git a/SignalMessaging/profiles/OWSProfileManager.m b/SignalMessaging/profiles/OWSProfileManager.m index 8b8bfb815..b0aecb3a1 100644 --- a/SignalMessaging/profiles/OWSProfileManager.m +++ b/SignalMessaging/profiles/OWSProfileManager.m @@ -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); diff --git a/SignalMessaging/profiles/OWSUserProfile.m b/SignalMessaging/profiles/OWSUserProfile.m index 5bcf35de0..ef56f4a05 100644 --- a/SignalMessaging/profiles/OWSUserProfile.m +++ b/SignalMessaging/profiles/OWSUserProfile.m @@ -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); diff --git a/SignalServiceKit/src/Devices/OWSLinkedDeviceReadReceipt.m b/SignalServiceKit/src/Devices/OWSLinkedDeviceReadReceipt.m index ed4d442a0..8a402067a 100644 --- a/SignalServiceKit/src/Devices/OWSLinkedDeviceReadReceipt.m +++ b/SignalServiceKit/src/Devices/OWSLinkedDeviceReadReceipt.m @@ -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); diff --git a/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m b/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m index 7c700bab4..f0cbd22fc 100644 --- a/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m +++ b/SignalServiceKit/src/Devices/OWSReadReceiptsForSenderMessage.m @@ -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 *)messageTimestamps; +- (instancetype)initWithThread:(nullable TSThread *)thread messageTimestamps:(NSArray *)messageTimestamps { self = [super initWithTimestamp:[NSDate ows_millisecondTimeStamp] inThread:thread]; if (!self) { diff --git a/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSyncMessage.m b/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSyncMessage.m index d8b528417..3001e1e76 100644 --- a/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSyncMessage.m +++ b/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSyncMessage.m @@ -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; diff --git a/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m b/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m index 83380d738..de3e42b67 100644 --- a/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m +++ b/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m @@ -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]; diff --git a/SignalServiceKit/src/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m b/SignalServiceKit/src/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m index bbd80e11f..9340e7a0e 100644 --- a/SignalServiceKit/src/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m +++ b/SignalServiceKit/src/Storage/AxolotlStore/TSStorageManager+SignedPreKeyStore.m @@ -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]; diff --git a/SignalServiceKit/src/Util/Cryptography.m b/SignalServiceKit/src/Util/Cryptography.m index e11773a65..9dd8909c0 100755 --- a/SignalServiceKit/src/Util/Cryptography.m +++ b/SignalServiceKit/src/Util/Cryptography.m @@ -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. diff --git a/SignalServiceKit/src/Util/DataSource.m b/SignalServiceKit/src/Util/DataSource.m index e5602ade1..4de4f63e0 100755 --- a/SignalServiceKit/src/Util/DataSource.m +++ b/SignalServiceKit/src/Util/DataSource.m @@ -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);