mirror of https://github.com/oxen-io/session-ios
parent
725153307e
commit
70e536ca8f
@ -0,0 +1,16 @@
|
|||||||
|
// Created by Michael Kirk on 11/7/16.
|
||||||
|
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||||
|
|
||||||
|
#import "TSYapDatabaseObject.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface TSPrivacyPreferences : TSYapDatabaseObject
|
||||||
|
|
||||||
|
+ (instancetype)sharedInstance;
|
||||||
|
|
||||||
|
@property BOOL shouldBlockOnIdentityChange;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,45 @@
|
|||||||
|
// Created by Michael Kirk on 11/7/16.
|
||||||
|
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||||
|
|
||||||
|
#import "TSPrivacyPreferences.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
NSString *const TSPrivacyPreferencesSingletonKey = @"TSPrivacyPreferences";
|
||||||
|
|
||||||
|
@implementation TSPrivacyPreferences
|
||||||
|
|
||||||
|
+ (instancetype)sharedInstance
|
||||||
|
{
|
||||||
|
static TSPrivacyPreferences *sharedInstance;
|
||||||
|
static dispatch_once_t onceToken;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
|
sharedInstance = [self fetchObjectWithUniqueID:TSPrivacyPreferencesSingletonKey];
|
||||||
|
if (!sharedInstance) {
|
||||||
|
sharedInstance = [[self alloc] initDefault];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return sharedInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initDefault
|
||||||
|
{
|
||||||
|
return [self initWithShouldBlockOnIdentityChange:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithShouldBlockOnIdentityChange:(BOOL)shouldBlockOnIdentityChange
|
||||||
|
{
|
||||||
|
self = [super initWithUniqueId:TSPrivacyPreferencesSingletonKey];
|
||||||
|
if (!self) {
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
_shouldBlockOnIdentityChange = shouldBlockOnIdentityChange;
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@ -1,13 +0,0 @@
|
|||||||
//
|
|
||||||
// UserPreferences.h
|
|
||||||
// Pods
|
|
||||||
//
|
|
||||||
// Created by Frederic Jacobs on 05/12/15.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@protocol UserPreferencesProtocol <NSObject>
|
|
||||||
|
|
||||||
@end
|
|
Loading…
Reference in New Issue