Clean up backup code.

pull/1/head
Matthew Chen 7 years ago committed by Matthew Chen
parent 08149005b1
commit 70d14c84c4

@ -284,10 +284,6 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
}
[self updateBarButtonItems];
dispatch_async(dispatch_get_main_queue(), ^{
[self settingsButtonPressed:nil];
});
}
- (void)viewDidAppear:(BOOL)animated

@ -111,9 +111,7 @@ NS_ASSUME_NONNULL_BEGIN
{
OWSAssert(value);
// TODO: This should eventually be the backup key stored in the Signal Service
// and retrieved with the backup PIN. It will eventually be stored in
// the keychain.
// TODO: Use actual key.
[self.dbConnection setObject:value
forKey:OWSBackup_BackupKeyKey
inCollection:OWSPrimaryStorage_OWSBackupCollection];
@ -124,8 +122,7 @@ NS_ASSUME_NONNULL_BEGIN
NSData *_Nullable result =
[self.dbConnection objectForKey:OWSBackup_BackupKeyKey inCollection:OWSPrimaryStorage_OWSBackupCollection];
if (!result) {
// TODO: This is temporary measure until we have proper private key
// storage in the service.
// TODO: Use actual key.
const NSUInteger kBackupPrivateKeyLength = 32;
result = [Randomness generateRandomBytes:kBackupPrivateKeyLength];
[self setBackupPrivateKey:result];
@ -208,18 +205,16 @@ NS_ASSUME_NONNULL_BEGIN
NSDate *_Nullable lastExportSuccessDate = self.lastExportSuccessDate;
NSDate *_Nullable lastExportFailureDate = self.lastExportFailureDate;
// Wait N hours before retrying after a success.
//
// TODO: Use actual values in production.
// const NSTimeInterval kRetryAfterSuccess = 24 * kHourInterval;
const NSTimeInterval kRetryAfterSuccess = 0;
const NSTimeInterval kRetryAfterSuccess = 24 * kHourInterval;
// TODO: Remove.
// const NSTimeInterval kRetryAfterSuccess = 0;
if (lastExportSuccessDate && fabs(lastExportSuccessDate.timeIntervalSinceNow) < kRetryAfterSuccess) {
return NO;
}
// Wait N hours before retrying after a failure.
//
// TODO: Use actual values in production.
// const NSTimeInterval kRetryAfterFailure = 6 * kHourInterval;
const NSTimeInterval kRetryAfterFailure = 0;
const NSTimeInterval kRetryAfterFailure = 6 * kHourInterval;
// TODO: Remove.
// const NSTimeInterval kRetryAfterFailure = 0;
if (lastExportFailureDate && fabs(lastExportFailureDate.timeIntervalSinceNow) < kRetryAfterFailure) {
return NO;
}

@ -15,8 +15,7 @@ typedef void (^OWSBackupJobCompletion)(NSError *_Nullable error);
@protocol OWSBackupJobDelegate <NSObject>
// TODO: This should eventually be the backup key stored in the Signal Service
// and retrieved with the backup PIN.
// TODO: Use actual key.
- (nullable NSData *)backupKey;
// Either backupJobDidSucceed:... or backupJobDidFail:... will

Loading…
Cancel
Save