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.
session-ios/SignalServiceKit/src/Util/SSKPreferences.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()
}
}