mirror of https://github.com/oxen-io/session-ios
Merge branch 'charlesmchen/linkPreviewsPreference'
commit
186e4e14d2
@ -1 +1 @@
|
|||||||
Subproject commit 8b2c886d38cb286341dad31a83ba59a25c30879f
|
Subproject commit 6438a8ea501bb83f12c4224fd87dd9491319fc3e
|
@ -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