mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
c2aa17e362
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
31 lines
992 B
Objective-C
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
|