Merge branch 'release/2.32.0'

pull/1/head
Matthew Chen 7 years ago
commit d70aa4418f

@ -193,20 +193,8 @@
actionBlock:^{
[weakSelf showAdvanced];
}]];
// Show backup UI in debug builds OR if backup has already been enabled.
//
// NOTE: Backup format is not yet finalized and backups are not yet
// properly encrypted, so these debug backups should only be
// done on test devices and will not be usable if/when we ship
// backup to production.
//
// TODO: Always show backup when we go to production.
BOOL isBackupEnabled = [OWSBackup.sharedManager isBackupEnabled];
BOOL showBackup = isBackupEnabled;
SUPPRESS_DEADSTORE_WARNING(showBackup);
#ifdef DEBUG
showBackup = YES;
#endif
BOOL showBackup = (OWSBackup.isFeatureEnabled && isBackupEnabled);
if (showBackup) {
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BACKUP",
@"Label for the backup view in app settings.")

@ -35,6 +35,11 @@ class DebugUIProfile: DebugUIPage {
OWSTableItem(title: "Log User Profiles") {
profileManager.logUserProfiles()
},
OWSTableItem(title: "Log Profile Key") {
let localProfileKey = profileManager.localProfileKey()
Logger.info("localProfileKey: \(localProfileKey.keyData.hexadecimalString)")
profileManager.logUserProfiles()
},
OWSTableItem(title: "Regenerate Profile/ProfileKey") {
profileManager.regenerateLocalProfile()
},

@ -51,6 +51,8 @@ NSError *OWSBackupErrorWithDescription(NSString *description);
@property (nonatomic, readonly, nullable) NSString *backupExportDescription;
@property (nonatomic, readonly, nullable) NSNumber *backupExportProgress;
+ (BOOL)isFeatureEnabled;
- (BOOL)isBackupEnabled;
- (void)setIsBackupEnabled:(BOOL)value;

@ -186,6 +186,11 @@ NSError *OWSBackupErrorWithDescription(NSString *description)
return SSKEnvironment.shared.tsAccountManager;
}
+ (BOOL)isFeatureEnabled
{
return NO;
}
#pragma mark - Backup Export
- (void)tryToExportBackup
@ -349,6 +354,10 @@ NSError *OWSBackupErrorWithDescription(NSString *description)
{
OWSAssertIsOnMainThread();
if (!OWSBackup.isFeatureEnabled) {
return;
}
if (!CurrentAppContext().isMainApp) {
return;
}

@ -860,6 +860,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
{
OWSUserProfile *userProfile = self.localUserProfile;
[userProfile clearWithProfileKey:[OWSAES256Key generateRandomKey] dbConnection:self.dbConnection completion:nil];
[self.tsAccountManager updateAccountAttributes];
}
- (void)addUserToProfileWhitelist:(NSString *)recipientId

@ -741,6 +741,17 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O
}
}
- (dispatch_queue_t)serialQueue
{
static dispatch_queue_t _serialQueue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_serialQueue = dispatch_queue_create("org.signal.websocket", DISPATCH_QUEUE_SERIAL);
});
return _serialQueue;
}
- (void)processWebSocketRequestMessage:(WebSocketProtoWebSocketRequestMessage *)message
{
OWSAssertIsOnMainThread();
@ -756,7 +767,7 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O
__block OWSBackgroundTask *_Nullable backgroundTask =
[OWSBackgroundTask backgroundTaskWithLabelStr:__PRETTY_FUNCTION__];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(self.serialQueue, ^{
BOOL success = NO;
@try {
NSData *_Nullable decryptedPayload =

Loading…
Cancel
Save