ui: set local file encryption in the core (#3227)

This commit is contained in:
Evgeny Poberezkin 2023-10-15 20:58:39 +01:00 committed by GitHub
parent e6b0983c3e
commit 43b67ba157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 9 deletions

View file

@ -216,7 +216,7 @@ func startChat() -> DBMigrationResult? {
try apiSetTempFolder(tempFolder: getTempFilesDirectory().path)
try apiSetFilesFolder(filesFolder: getAppFilesDirectory().path)
try setXFTPConfig(xftpConfig)
// try apiSetEncryptLocalFiles(privacyEncryptLocalFilesGroupDefault.get())
try apiSetEncryptLocalFiles(privacyEncryptLocalFilesGroupDefault.get())
let justStarted = try apiStartChat()
chatStarted = true
if justStarted {
@ -352,8 +352,8 @@ func setXFTPConfig(_ cfg: XFTPFileConfig?) throws {
throw r
}
func apiSetEncryptLocalFiles(_ enable: Boolean) throws {
let r = chatSendCmdSync(.apiSetEncryptLocalFiles(enable: enable))
func apiSetEncryptLocalFiles(_ enable: Bool) throws {
let r = sendSimpleXCmd(.apiSetEncryptLocalFiles(enable: enable))
if case .cmdOk = r { return }
throw r
}