mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.0 KiB
Swift
30 lines
1.0 KiB
Swift
//
|
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
@objc
|
|
public class SSKPreferences: NSObject {
|
|
// Never instantiate this class.
|
|
private override init() {}
|
|
|
|
private static let collection = "SSKPreferences"
|
|
private static let areLinkPreviewsEnabledKey = "areLinkPreviewsEnabled"
|
|
|
|
@objc
|
|
public class func areLinkPreviewsEnabled() -> Bool {
|
|
return OWSPrimaryStorage.dbReadConnection().bool(forKey: areLinkPreviewsEnabledKey,
|
|
inCollection: collection,
|
|
defaultValue: true)
|
|
}
|
|
|
|
@objc
|
|
public class func setAreLinkPreviewsEnabled(value: Bool) {
|
|
OWSPrimaryStorage.dbReadWriteConnection().setBool(value,
|
|
forKey: areLinkPreviewsEnabledKey,
|
|
inCollection: collection)
|
|
SSKEnvironment.shared.syncManager.sendConfigurationSyncMessage()
|
|
}
|
|
}
|