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.
24 lines
679 B
Swift
24 lines
679 B
Swift
|
|
extension Storage {
|
|
|
|
public func with(_ work: @escaping (Any) -> Void) {
|
|
Storage.writeSync { work($0) }
|
|
}
|
|
|
|
public func withAsync(_ work: @escaping (Any) -> Void, completion: @escaping () -> Void) {
|
|
Storage.write(with: { work($0) }, completion: completion)
|
|
}
|
|
|
|
public func getUserPublicKey() -> String? {
|
|
return OWSIdentityManager.shared().identityKeyPair()?.publicKey.toHexString()
|
|
}
|
|
|
|
public func getUserKeyPair() -> ECKeyPair? {
|
|
return OWSIdentityManager.shared().identityKeyPair()
|
|
}
|
|
|
|
public func getUserDisplayName() -> String? {
|
|
return SSKEnvironment.shared.profileManager.localProfileName()
|
|
}
|
|
}
|