Merge branch 'mkirk/fix-build-warnings'

pull/1/head
Michael Kirk 7 years ago
commit 2cc417daf7

@ -185,7 +185,7 @@ SPEC CHECKSUMS:
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c
SignalServiceKit: cfcc3b067458b74392750ed324fb40d5bcfa2b2a SignalServiceKit: e1fa31c513e47afcb02c9c540d2931fd24d86311
SocketRocket: dbb1554b8fc288ef8ef370d6285aeca7361be31e SocketRocket: dbb1554b8fc288ef8ef370d6285aeca7361be31e
SQLCipher: 43d12c0eb9c57fb438749618fc3ce0065509a559 SQLCipher: 43d12c0eb9c57fb438749618fc3ce0065509a559
TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c

@ -3493,6 +3493,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9B533A9FA46206D3D99C9ADA /* Pods-SignalMessaging.debug.xcconfig */; baseConfigurationReference = 9B533A9FA46206D3D99C9ADA /* Pods-SignalMessaging.debug.xcconfig */;
buildSettings = { buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@ -3546,6 +3547,7 @@
baseConfigurationReference = 948239851C08032C842937CC /* Pods-SignalMessaging.test.xcconfig */; baseConfigurationReference = 948239851C08032C842937CC /* Pods-SignalMessaging.test.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@ -3618,6 +3620,7 @@
baseConfigurationReference = 8EEE74B0753448C085B48721 /* Pods-SignalMessaging.app store release.xcconfig */; baseConfigurationReference = 8EEE74B0753448C085B48721 /* Pods-SignalMessaging.app store release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";

@ -67,7 +67,7 @@ class ModalActivityIndicatorViewController: OWSViewController {
override func loadView() { override func loadView() {
super.loadView() super.loadView()
self.view.backgroundColor = UIColor(colorLiteralRed: 0, green: 0, blue: 0, alpha: 0.25) self.view.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.25)
self.view.isOpaque = false self.view.isOpaque = false
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle:.whiteLarge) let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle:.whiteLarge)

@ -28,7 +28,7 @@ class ExperienceUpgrade: TSYapDatabaseObject {
super.init(uniqueId: uniqueId) super.init(uniqueId: uniqueId)
} }
required init!(coder: NSCoder!) { required init!(coder: NSCoder) {
// This is the unfortunate seam between strict swift and fast-and-loose objc // This is the unfortunate seam between strict swift and fast-and-loose objc
// we can't leave these properties nil, since we really "don't know" that the superclass // we can't leave these properties nil, since we really "don't know" that the superclass
// will assign them. // will assign them.

@ -802,7 +802,7 @@ extension URLSessionTask {
return return
} }
guard let httpResponse = task.response as? HTTPURLResponse else { guard let httpResponse = task.response as? HTTPURLResponse else {
Logger.error("\(TAG) missing or unexpected response: \(task.response)") Logger.error("\(TAG) missing or unexpected response: \(String(describing: task.response))")
segmentRequestDidFail(assetRequest:assetRequest, assetSegment:assetSegment) segmentRequestDidFail(assetRequest:assetRequest, assetSegment:assetSegment)
return return
} }

@ -18,6 +18,12 @@ NS_ASSUME_NONNULL_BEGIN
return [UIApplication sharedApplication].applicationState == UIApplicationStateActive; return [UIApplication sharedApplication].applicationState == UIApplicationStateActive;
} }
- (BOOL)isRTL
{
return
[[UIApplication sharedApplication] userInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft;
}
- (UIApplicationState)mainApplicationState - (UIApplicationState)mainApplicationState
{ {
return [UIApplication sharedApplication].applicationState; return [UIApplication sharedApplication].applicationState;

@ -8,7 +8,7 @@
+ (UIFont *)ows_thinFontWithSize:(CGFloat)size + (UIFont *)ows_thinFontWithSize:(CGFloat)size
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(8, 2)) { if (@available(iOS 8.2, *)) {
return [UIFont systemFontOfSize:size weight:UIFontWeightThin]; return [UIFont systemFontOfSize:size weight:UIFontWeightThin];
} else { } else {
return [UIFont fontWithName:@"HelveticaNeue-Thin" size:size]; return [UIFont fontWithName:@"HelveticaNeue-Thin" size:size];
@ -17,7 +17,7 @@
+ (UIFont *)ows_lightFontWithSize:(CGFloat)size + (UIFont *)ows_lightFontWithSize:(CGFloat)size
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(8, 2)) { if (@available(iOS 8.2, *)) {
return [UIFont systemFontOfSize:size weight:UIFontWeightLight]; return [UIFont systemFontOfSize:size weight:UIFontWeightLight];
} else { } else {
return [UIFont fontWithName:@"HelveticaNeue-Light" size:size]; return [UIFont fontWithName:@"HelveticaNeue-Light" size:size];
@ -26,7 +26,7 @@
+ (UIFont *)ows_regularFontWithSize:(CGFloat)size + (UIFont *)ows_regularFontWithSize:(CGFloat)size
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(8, 2)) { if (@available(iOS 8.2, *)) {
return [UIFont systemFontOfSize:size weight:UIFontWeightRegular]; return [UIFont systemFontOfSize:size weight:UIFontWeightRegular];
} else { } else {
return [UIFont fontWithName:@"HelveticaNeue" size:size]; return [UIFont fontWithName:@"HelveticaNeue" size:size];
@ -35,7 +35,7 @@
+ (UIFont *)ows_mediumFontWithSize:(CGFloat)size + (UIFont *)ows_mediumFontWithSize:(CGFloat)size
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(8, 2)) { if (@available(iOS 8.2, *)) {
return [UIFont systemFontOfSize:size weight:UIFontWeightMedium]; return [UIFont systemFontOfSize:size weight:UIFontWeightMedium];
} else { } else {
return [UIFont fontWithName:@"HelveticaNeue-Medium" size:size]; return [UIFont fontWithName:@"HelveticaNeue-Medium" size:size];
@ -83,7 +83,7 @@
+ (UIFont *)ows_dynamicTypeTitle2Font + (UIFont *)ows_dynamicTypeTitle2Font
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
return [UIFont preferredFontForTextStyle:UIFontTextStyleTitle2]; return [UIFont preferredFontForTextStyle:UIFontTextStyleTitle2];
} else { } else {
// Dynamic title font for ios8 defaults to bold 12.0 pt, whereas ios9+ it's 22.0pt regular weight. // Dynamic title font for ios8 defaults to bold 12.0 pt, whereas ios9+ it's 22.0pt regular weight.
@ -96,7 +96,7 @@
+ (UIFont *)ows_dynamicTypeHeadlineFont + (UIFont *)ows_dynamicTypeHeadlineFont
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
return [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; return [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
} else { } else {
// See ows_dynamicTypeTitle2Font. // See ows_dynamicTypeTitle2Font.

@ -4,6 +4,7 @@
#import "OWSMath.h" #import "OWSMath.h"
#import "UIView+OWS.h" #import "UIView+OWS.h"
#import <SignalServiceKit/AppContext.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -252,12 +253,11 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
- (BOOL)isRTL - (BOOL)isRTL
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
return ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] return ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute]
== UIUserInterfaceLayoutDirectionRightToLeft); == UIUserInterfaceLayoutDirectionRightToLeft);
} else { } else {
return return [CurrentAppContext() isRTL];
[UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
} }
} }
@ -268,7 +268,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
- (NSLayoutConstraint *)autoPinLeadingToSuperviewWithMargin:(CGFloat)margin - (NSLayoutConstraint *)autoPinLeadingToSuperviewWithMargin:(CGFloat)margin
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.leadingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.leadingAnchor [self.leadingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.leadingAnchor
constant:margin]; constant:margin];
@ -287,7 +287,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
- (NSLayoutConstraint *)autoPinTrailingToSuperviewWithMargin:(CGFloat)margin - (NSLayoutConstraint *)autoPinTrailingToSuperviewWithMargin:(CGFloat)margin
{ {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.trailingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.trailingAnchor [self.trailingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.trailingAnchor
constant:-margin]; constant:-margin];
@ -310,7 +310,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
{ {
OWSAssert(view); OWSAssert(view);
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.leadingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; [self.leadingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin];
constraint.active = YES; constraint.active = YES;
@ -331,7 +331,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
{ {
OWSAssert(view); OWSAssert(view);
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.trailingAnchor constraintEqualToAnchor:view.leadingAnchor constant:-margin]; [self.trailingAnchor constraintEqualToAnchor:view.leadingAnchor constant:-margin];
constraint.active = YES; constraint.active = YES;
@ -352,7 +352,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
{ {
OWSAssert(view); OWSAssert(view);
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:margin]; [self.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:margin];
constraint.active = YES; constraint.active = YES;
@ -373,7 +373,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
{ {
OWSAssert(view); OWSAssert(view);
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (@available(iOS 9.0, *)) {
NSLayoutConstraint *constraint = NSLayoutConstraint *constraint =
[self.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; [self.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin];
constraint.active = YES; constraint.active = YES;

@ -27,6 +27,12 @@ An Objective-C library for communicating with the Signal messaging service.
s.requires_arc = true s.requires_arc = true
s.source_files = 'SignalServiceKit/src/**/*.{h,m,mm}' s.source_files = 'SignalServiceKit/src/**/*.{h,m,mm}'
# We want to use modules to avoid clobbering CocoaLumberjack macros defined
# by other OWS modules which *also* import CocoaLumberjack. But because we
# also use Objective-C++, modules are disabled unless we explicitly enable
# them
s.compiler_flags = "-fcxx-modules"
s.prefix_header_file = 'SignalServiceKit/src/TSPrefix.h' s.prefix_header_file = 'SignalServiceKit/src/TSPrefix.h'
s.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC' } s.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC' }

@ -344,7 +344,7 @@ static const NSTimeInterval kSignedPreKeyUpdateFailureMaxFailureDuration = 10 *
[self clearSignedPreKeyRecordsWithKeyId:currentSignedPrekeyId success:nil]; [self clearSignedPreKeyRecordsWithKeyId:currentSignedPrekeyId success:nil];
} }
+ (void)clearSignedPreKeyRecordsWithKeyId:(NSNumber *)keyId success:(void (^_Nullable)())successHandler + (void)clearSignedPreKeyRecordsWithKeyId:(NSNumber *)keyId success:(void (^_Nullable)(void))successHandler
{ {
if (!keyId) { if (!keyId) {
OWSFail(@"%@ Ignoring request to clear signed preKeys since no keyId was specified", self.logTag); OWSFail(@"%@ Ignoring request to clear signed preKeys since no keyId was specified", self.logTag);

@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
andImage:(nullable UIImage *)image andImage:(nullable UIImage *)image
andContactID:(ABRecordID)record; andContactID:(ABRecordID)record;
- (instancetype)initWithSystemContact:(CNContact *)contact; - (instancetype)initWithSystemContact:(CNContact *)contact NS_AVAILABLE_IOS(9_0);
- (NSString *)nameForPhoneNumber:(NSString *)recipientId; - (NSString *)nameForPhoneNumber:(NSString *)recipientId;

@ -305,7 +305,7 @@ static const CGFloat kAttachmentDownloadProgressTheta = 0.001f;
return; return;
} }
void (^abortDownload)() = ^{ void (^abortDownload)(void) = ^{
OWSFail(@"%@ Download aborted.", self.logTag); OWSFail(@"%@ Download aborted.", self.logTag);
[task cancel]; [task cancel];
}; };

@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
@class OWSSignalServiceProtosEnvelope; @class OWSSignalServiceProtosEnvelope;
typedef void (^DecryptSuccessBlock)(NSData *_Nullable plaintextData); typedef void (^DecryptSuccessBlock)(NSData *_Nullable plaintextData);
typedef void (^DecryptFailureBlock)(); typedef void (^DecryptFailureBlock)(void);
@interface OWSMessageDecrypter : OWSMessageHandler @interface OWSMessageDecrypter : OWSMessageHandler

@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
void AssertIsOnSendingQueue() void AssertIsOnSendingQueue()
{ {
#ifdef DEBUG #ifdef DEBUG
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(10, 0)) { if (@available(iOS 10.0, *)) {
dispatch_assert_queue([OWSDispatch sendingQueue]); dispatch_assert_queue([OWSDispatch sendingQueue]);
} // else, skip assert as it's a development convenience. } // else, skip assert as it's a development convenience.
#endif #endif

@ -47,7 +47,7 @@ static const CGFloat kAttachmentUploadProgressTheta = 0.001f;
success:(void (^)(void))successHandler success:(void (^)(void))successHandler
failure:(RetryableFailureHandler)failureHandler failure:(RetryableFailureHandler)failureHandler
{ {
void (^successHandlerWrapper)() = ^{ void (^successHandlerWrapper)(void) = ^{
[self fireProgressNotification:1 attachmentId:attachmentStream.uniqueId]; [self fireProgressNotification:1 attachmentId:attachmentStream.uniqueId];
successHandler(); successHandler();
@ -61,7 +61,7 @@ static const CGFloat kAttachmentUploadProgressTheta = 0.001f;
if (attachmentStream.serverId) { if (attachmentStream.serverId) {
DDLogDebug(@"%@ Attachment previously uploaded.", self.logTag); DDLogDebug(@"%@ Attachment previously uploaded.", self.logTag);
successHandlerWrapper(outgoingMessage); successHandlerWrapper();
return; return;
} }

@ -1,4 +1,6 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved. //
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "TSRequest.h" #import "TSRequest.h"
@ -12,4 +14,4 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface TSProfileAvatarUploadFormRequest : TSRequest @interface TSProfileAvatarUploadFormRequest : TSRequest
- (nullable instancetype)init; - (instancetype)init;
@end @end

@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation TSProfileAvatarUploadFormRequest @implementation TSProfileAvatarUploadFormRequest
- (nullable instancetype)init - (instancetype)init
{ {
self = [super initWithURL:[NSURL URLWithString:textSecureProfileAvatarFormAPI]]; self = [super initWithURL:[NSURL URLWithString:textSecureProfileAvatarFormAPI]];

@ -20,7 +20,7 @@ extern NSString *const kNSNotificationName_IsCensorshipCircumventionActiveDidCha
@property (atomic, readonly) BOOL isCensorshipCircumventionActive; @property (atomic, readonly) BOOL isCensorshipCircumventionActive;
@property (nonatomic, readonly) BOOL hasCensoredPhoneNumber; @property (atomic, readonly) BOOL hasCensoredPhoneNumber;
+ (instancetype)sharedInstance; + (instancetype)sharedInstance;

@ -11,7 +11,7 @@ NSString *const kSessionStoreDBConnectionKey = @"kSessionStoreDBConnectionKey";
void AssertIsOnSessionStoreQueue() void AssertIsOnSessionStoreQueue()
{ {
#ifdef DEBUG #ifdef DEBUG
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(10, 0)) { if (@available(iOS 10.0, *)) {
dispatch_assert_queue([OWSDispatch sessionStoreQueue]); dispatch_assert_queue([OWSDispatch sessionStoreQueue]);
} // else, skip assert as it's a development convenience. } // else, skip assert as it's a development convenience.
#endif #endif

@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)auditAsync; + (void)auditAsync;
// completion, if present, will be invoked on the main thread. // completion, if present, will be invoked on the main thread.
+ (void)auditAndCleanupAsync:(void (^_Nullable)())completion; + (void)auditAndCleanupAsync:(void (^_Nullable)(void))completion;
+ (NSSet<NSString *> *)filePathsInAttachmentsFolder; + (NSSet<NSString *> *)filePathsInAttachmentsFolder;

@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
}); });
} }
+ (void)auditAndCleanupAsync:(void (^_Nullable)())completion + (void)auditAndCleanupAsync:(void (^_Nullable)(void))completion
{ {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[OWSOrphanedDataCleaner auditAndCleanup:YES completion:completion]; [OWSOrphanedDataCleaner auditAndCleanup:YES completion:completion];
@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
// They can't be cleaned up - we don't want to delete the TSAttachmentStream or // They can't be cleaned up - we don't want to delete the TSAttachmentStream or
// its corresponding message. Better that the broken message shows up in the // its corresponding message. Better that the broken message shows up in the
// conversation view. // conversation view.
+ (void)auditAndCleanup:(BOOL)shouldCleanup completion:(void (^_Nullable)())completion + (void)auditAndCleanup:(BOOL)shouldCleanup completion:(void (^_Nullable)(void))completion
{ {
NSSet<NSString *> *diskFilePaths = [self filePathsInAttachmentsFolder]; NSSet<NSString *> *diskFilePaths = [self filePathsInAttachmentsFolder];
long long totalFileSize = [self fileSizeOfFilePaths:diskFilePaths.allObjects]; long long totalFileSize = [self fileSizeOfFilePaths:diskFilePaths.allObjects];

@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
* Specifically, these migration should not depend on or affect the data * Specifically, these migration should not depend on or affect the data
* of any database view. * of any database view.
*/ */
- (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)())safeBlockingMigrationsBlock; - (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)(void))safeBlockingMigrationsBlock;
- (void)deleteThreadsAndMessages; - (void)deleteThreadsAndMessages;
- (void)resetSignalStorage; - (void)resetSignalStorage;

@ -307,7 +307,7 @@ void setDatabaseInitialized()
}; };
} }
- (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)())safeBlockingMigrationsBlock - (void)setupDatabaseWithSafeBlockingMigrations:(void (^_Nonnull)(void))safeBlockingMigrationsBlock
{ {
// Synchronously register extensions which are essential for views. // Synchronously register extensions which are essential for views.
[TSDatabaseView registerCrossProcessNotifier]; [TSDatabaseView registerCrossProcessNotifier];

@ -2,8 +2,6 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
@class TSNumberVerifier;
#ifndef TextSecureKit_Constants_h #ifndef TextSecureKit_Constants_h
#define TextSecureKit_Constants_h #define TextSecureKit_Constants_h
@ -15,8 +13,6 @@ typedef NS_ENUM(NSInteger, TSWhisperMessageType) {
TSUnencryptedWhisperMessageType = 4, TSUnencryptedWhisperMessageType = 4,
}; };
typedef enum { kSMSVerification, kPhoneNumberVerification } VerificationTransportType;
#pragma mark Server Address #pragma mark Server Address
#define textSecureHTTPTimeOut 10 #define textSecureHTTPTimeOut 10
@ -41,7 +37,6 @@ typedef enum { kSMSVerification, kPhoneNumberVerification } VerificationTranspor
// //
//#endif //#endif
#define textSecureGeneralAPI @"v1"
#define textSecureAccountsAPI @"v1/accounts" #define textSecureAccountsAPI @"v1/accounts"
#define textSecureAttributesAPI @"/attributes/" #define textSecureAttributesAPI @"/attributes/"
@ -59,14 +54,4 @@ typedef enum { kSMSVerification, kPhoneNumberVerification } VerificationTranspor
#define SignalApplicationGroup @"group.org.whispersystems.signal.group" #define SignalApplicationGroup @"group.org.whispersystems.signal.group"
#pragma mark Push RegistrationSpecific Constants
typedef NS_ENUM(NSInteger, TSPushRegistrationError) {
TSPushRegistrationErrorNetwork,
TSPushRegistrationErrorAuthentication,
TSPushRegistrationErrorRequest
};
typedef void (^failedPushRegistrationRequestBlock)(TSPushRegistrationError error);
#endif #endif

@ -4,15 +4,12 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h> @import CocoaLumberjack;
#define LOG_LEVEL_DEF sskLogLevel
#define LOG_ASYNC_ENABLED YES
#ifdef DEBUG #ifdef DEBUG
static const NSUInteger sskLogLevel = DDLogLevelAll; static const NSUInteger ddLogLevel = DDLogLevelAll;
#else #else
static const NSUInteger sskLogLevel = DDLogLevelInfo; static const NSUInteger ddLogLevel = DDLogLevelInfo;
#endif #endif
#import "Asserts.h" #import "Asserts.h"

@ -26,6 +26,8 @@ typedef void (^BackgroundTaskExpirationHandler)(void);
// Should only be called if isMainApp is YES. // Should only be called if isMainApp is YES.
- (void)setMainAppBadgeNumber:(NSInteger)value; - (void)setMainAppBadgeNumber:(NSInteger)value;
- (BOOL)isRTL;
@end @end
id<AppContext> CurrentAppContext(void); id<AppContext> CurrentAppContext(void);

@ -44,7 +44,7 @@ typedef NS_ENUM(NSUInteger, OWSAnalyticsSeverity) {
@end @end
typedef NSDictionary<NSString *, id> *_Nonnull (^OWSProdAssertParametersBlock)(); typedef NSDictionary<NSString *, id> *_Nonnull (^OWSProdAssertParametersBlock)(void);
// These methods should be used to assert errors for which we want to fire analytics events. // These methods should be used to assert errors for which we want to fire analytics events.
// //

@ -222,8 +222,8 @@ NSString *NSStringForOWSAnalyticsSeverity(OWSAnalyticsSeverity severity)
- (void)submitEvent:(NSDictionary *)eventDictionary - (void)submitEvent:(NSDictionary *)eventDictionary
eventKey:(NSString *)eventKey eventKey:(NSString *)eventKey
success:(void (^_Nonnull)())successBlock success:(void (^_Nonnull)(void))successBlock
failure:(void (^_Nonnull)())failureBlock failure:(void (^_Nonnull)(void))failureBlock
{ {
OWSAssert(eventDictionary); OWSAssert(eventDictionary);
OWSAssert(eventKey); OWSAssert(eventKey);
@ -311,7 +311,7 @@ NSString *NSStringForOWSAnalyticsSeverity(OWSAnalyticsSeverity severity)
return; return;
} }
void (^addEvent)() = ^{ void (^addEvent)(void) = ^{
// Add super properties. // Add super properties.
NSMutableDictionary *eventProperties = (properties ? [properties mutableCopy] : [NSMutableDictionary new]); NSMutableDictionary *eventProperties = (properties ? [properties mutableCopy] : [NSMutableDictionary new]);
[eventProperties addEntriesFromDictionary:self.eventSuperProperties]; [eventProperties addEntriesFromDictionary:self.eventSuperProperties];

@ -24,6 +24,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
void AssertIsOnMainThread(); void AssertIsOnMainThread(void);
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -30,12 +30,12 @@ typedef NS_ENUM(NSInteger, OWSErrorCode) {
}; };
extern NSError *OWSErrorWithCodeDescription(OWSErrorCode code, NSString *description); extern NSError *OWSErrorWithCodeDescription(OWSErrorCode code, NSString *description);
extern NSError *OWSErrorMakeUnableToProcessServerResponseError(); extern NSError *OWSErrorMakeUnableToProcessServerResponseError(void);
extern NSError *OWSErrorMakeFailedToSendOutgoingMessageError(); extern NSError *OWSErrorMakeFailedToSendOutgoingMessageError(void);
extern NSError *OWSErrorMakeNoSuchSignalRecipientError(); extern NSError *OWSErrorMakeNoSuchSignalRecipientError(void);
extern NSError *OWSErrorMakeAssertionError(); extern NSError *OWSErrorMakeAssertionError(void);
extern NSError *OWSErrorMakeMessageSendDisabledDueToPreKeyUpdateFailuresError(); extern NSError *OWSErrorMakeMessageSendDisabledDueToPreKeyUpdateFailuresError(void);
extern NSError *OWSErrorMakeMessageSendFailedToBlockListError(); extern NSError *OWSErrorMakeMessageSendFailedToBlockListError(void);
extern NSError *OWSErrorMakeWriteAttachmentDataError(); extern NSError *OWSErrorMakeWriteAttachmentDataError(void);
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
#define AssertOnDispatchQueue(queue) \ #define AssertOnDispatchQueue(queue) \
{ \ { \
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(10, 0)) { \ if (@available(iOS 10.0, *)) { \
dispatch_assert_queue(queue); \ dispatch_assert_queue(queue); \
} else { \ } else { \
_Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \ _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \

@ -18,6 +18,15 @@ NS_ASSUME_NONNULL_BEGIN
return NO; return NO;
} }
- (BOOL)isRTL
{
// Borrowed from PureLayout's AppExtension compatible RTL support.
// App Extensions may not access -[UIApplication sharedApplication]; fall back to checking the bundle's preferred
// localization character direction
return [NSLocale characterDirectionForLanguage:[[NSBundle mainBundle] preferredLocalizations][0]]
== NSLocaleLanguageDirectionRightToLeft;
}
- (UIApplicationState)mainApplicationState - (UIApplicationState)mainApplicationState
{ {
OWSFail(@"%@ called %s.", self.logTag, __PRETTY_FUNCTION__); OWSFail(@"%@ called %s.", self.logTag, __PRETTY_FUNCTION__);

Loading…
Cancel
Save