session-ios/Signal/src/environment/Migrations/OWS101ExistingUsersBlockOnIdentityChange.m
Michael Kirk c2aa17e362 Changed Safety numbers no longer block communication
When your partner changes their identity key (e.g. by reinstalling),
you'll see a notice alongside their message, but it will no longer
prevent the message from showing. aka "non blocking".

Existing users will be opted into the previous blocking behavior.

This is configurable for all users in Settings > Privacy.

// FREEBIE
2016-11-11 09:13:38 -05:00

31 lines
992 B
Objective-C

// Created by Michael Kirk on 11/8/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
#import "OWS101ExistingUsersBlockOnIdentityChange.h"
#import <SignalServiceKit/TSPrivacyPreferences.h>
#import <YapDatabase/YapDatabaseTransaction.h>
NS_ASSUME_NONNULL_BEGIN
// Increment a similar constant for every future DBMigration
static NSString *const OWS101ExistingUsersBlockOnIdentityChangeMigrationId = @"101";
@implementation OWS101ExistingUsersBlockOnIdentityChange
+ (NSString *)migrationId
{
return OWS101ExistingUsersBlockOnIdentityChangeMigrationId;
}
- (void)runUpWithTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
DDLogWarn(@"[OWS101ExistingUsersBlockOnIdentityChange] Opting existing user into 'blocking' on identity changes.");
TSPrivacyPreferences *preferences = [TSPrivacyPreferences sharedInstance];
preferences.shouldBlockOnIdentityChange = YES;
[preferences saveWithTransaction:transaction];
}
@end
NS_ASSUME_NONNULL_END