mirror of https://github.com/oxen-io/session-ios
Add link previews setting.
parent
8c7c9b27a2
commit
c57b0d98cb
@ -0,0 +1,28 @@
|
||||
//
|
||||
// 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) {
|
||||
return OWSPrimaryStorage.dbReadWriteConnection().setBool(value,
|
||||
forKey: areLinkPreviewsEnabledKey,
|
||||
inCollection: collection)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue