Fix migration issue

pull/46/head
Niels Andriesse 6 years ago
parent 99d75f9b6d
commit e46f6ee9b8

@ -28,7 +28,7 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "AC9FA9C4CB8DFE0155BD054D6E704C10" BlueprintIdentifier = "11A6AC8599513843417D550671469823"
BuildableName = "SignalServiceKit.framework" BuildableName = "SignalServiceKit.framework"
BlueprintName = "SignalServiceKit" BlueprintName = "SignalServiceKit"
ReferencedContainer = "container:Pods/Pods.xcodeproj"> ReferencedContainer = "container:Pods/Pods.xcodeproj">

@ -65,6 +65,7 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
/*
if ([self isVersion:previousVersion atLeast:@"1.0.2" andLessThan:@"2.0"]) { if ([self isVersion:previousVersion atLeast:@"1.0.2" andLessThan:@"2.0"]) {
OWSLogError(@"Migrating from RedPhone no longer supported. Quitting."); OWSLogError(@"Migrating from RedPhone no longer supported. Quitting.");
// Not translating these as so few are affected. // Not translating these as so few are affected.
@ -83,6 +84,7 @@ NS_ASSUME_NONNULL_BEGIN
[CurrentAppContext().frontmostViewController presentAlert:alert]; [CurrentAppContext().frontmostViewController presentAlert:alert];
} }
*/
if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.1.70"] && [self.tsAccountManager isRegistered]) { if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.1.70"] && [self.tsAccountManager isRegistered]) {
[self clearVideoCache]; [self clearVideoCache];

@ -711,6 +711,8 @@ NSString *const TSAccountManager_NeedsAccountAttributesUpdateKey = @"TSAccountMa
return [AnyPromise promiseWithValue:@(1)]; return [AnyPromise promiseWithValue:@(1)];
} }
return [AnyPromise promiseWithValue:@(1)];
NSDate *_Nullable updateRequestDate = NSDate *_Nullable updateRequestDate =
[self.dbConnection objectForKey:TSAccountManager_NeedsAccountAttributesUpdateKey [self.dbConnection objectForKey:TSAccountManager_NeedsAccountAttributesUpdateKey
inCollection:TSAccountManager_UserAccountCollection]; inCollection:TSAccountManager_UserAccountCollection];

@ -350,6 +350,7 @@ NSString *const kOWSBlockingManager_SyncedBlockedGroupIdsKey = @"kOWSBlockingMan
// This method should only be called from within a synchronized block. // This method should only be called from within a synchronized block.
- (void)syncBlockListIfNecessary - (void)syncBlockListIfNecessary
{ {
/*
OWSAssertDebug(_blockedPhoneNumberSet); OWSAssertDebug(_blockedPhoneNumberSet);
// If we haven't yet successfully synced the current "block list" changes, // If we haven't yet successfully synced the current "block list" changes,
@ -376,6 +377,7 @@ NSString *const kOWSBlockingManager_SyncedBlockedGroupIdsKey = @"kOWSBlockingMan
OWSLogInfo(@"retrying sync of block list"); OWSLogInfo(@"retrying sync of block list");
[self sendBlockListSyncMessageWithPhoneNumbers:self.blockedPhoneNumbers groupIds:localBlockedGroupIds]; [self sendBlockListSyncMessageWithPhoneNumbers:self.blockedPhoneNumbers groupIds:localBlockedGroupIds];
*/
} }
- (void)sendBlockListSyncMessageWithPhoneNumbers:(NSArray<NSString *> *)blockedPhoneNumbers - (void)sendBlockListSyncMessageWithPhoneNumbers:(NSArray<NSString *> *)blockedPhoneNumbers

@ -220,7 +220,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *path = [textSecureAccountsAPI stringByAppendingString:textSecureAttributesAPI]; NSString *path = [textSecureAccountsAPI stringByAppendingString:textSecureAttributesAPI];
NSString *authKey = self.tsAccountManager.serverAuthToken; NSString *authKey = self.tsAccountManager.serverAuthToken;
OWSAssertDebug(authKey.length > 0); // OWSAssertDebug(authKey.length > 0);
NSString *_Nullable pin = [self.ows2FAManager pinCode]; NSString *_Nullable pin = [self.ows2FAManager pinCode];
NSDictionary<NSString *, id> *accountAttributes = [self accountAttributesWithPin:pin authKey:authKey]; NSDictionary<NSString *, id> *accountAttributes = [self accountAttributesWithPin:pin authKey:authKey];
@ -321,7 +321,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSDictionary<NSString *, id> *)accountAttributesWithPin:(nullable NSString *)pin + (NSDictionary<NSString *, id> *)accountAttributesWithPin:(nullable NSString *)pin
authKey:(NSString *)authKey authKey:(NSString *)authKey
{ {
OWSAssertDebug(authKey.length > 0); // OWSAssertDebug(authKey.length > 0);
uint32_t registrationId = [self.tsAccountManager getOrGenerateRegistrationId]; uint32_t registrationId = [self.tsAccountManager getOrGenerateRegistrationId];
BOOL isManualMessageFetchEnabled = self.tsAccountManager.isManualMessageFetchEnabled; BOOL isManualMessageFetchEnabled = self.tsAccountManager.isManualMessageFetchEnabled;

Loading…
Cancel
Save