mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-30 14:15:55 +00:00
core: temp-folder option (#3905)
This commit is contained in:
@@ -80,6 +80,7 @@ mkChatOpts BroadcastBotOpts {coreOptions} =
|
||||
chatCmdLog = CCLNone,
|
||||
chatServerPort = Nothing,
|
||||
optFilesFolder = Nothing,
|
||||
optTempDirectory = Nothing,
|
||||
showReactions = False,
|
||||
allowInstantFiles = True,
|
||||
autoAcceptFileSize = 0,
|
||||
|
||||
@@ -80,6 +80,7 @@ mkChatOpts DirectoryOpts {coreOptions} =
|
||||
chatCmdLog = CCLNone,
|
||||
chatServerPort = Nothing,
|
||||
optFilesFolder = Nothing,
|
||||
optTempDirectory = Nothing,
|
||||
showReactions = False,
|
||||
allowInstantFiles = True,
|
||||
autoAcceptFileSize = 0,
|
||||
|
||||
@@ -211,7 +211,7 @@ newChatController
|
||||
ChatDatabase {chatStore, agentStore}
|
||||
user
|
||||
cfg@ChatConfig {agentConfig = aCfg, defaultServers, inlineFiles, deviceNameForRemote}
|
||||
ChatOpts {coreOptions = CoreChatOpts {smpServers, xftpServers, networkConfig, logLevel, logConnections, logServerHosts, logFile, tbqSize, highlyAvailable}, deviceName, optFilesFolder, showReactions, allowInstantFiles, autoAcceptFileSize}
|
||||
ChatOpts {coreOptions = CoreChatOpts {smpServers, xftpServers, networkConfig, logLevel, logConnections, logServerHosts, logFile, tbqSize, highlyAvailable}, deviceName, optFilesFolder, optTempDirectory, showReactions, allowInstantFiles, autoAcceptFileSize}
|
||||
backgroundMode = do
|
||||
let inlineFiles' = if allowInstantFiles || autoAcceptFileSize > 0 then inlineFiles else inlineFiles {sendChunks = 0, receiveInstant = False}
|
||||
config = cfg {logLevel, showReactions, tbqSize, subscriptionEvents = logConnections, hostEvents = logServerHosts, defaultServers = configServers, inlineFiles = inlineFiles', autoAcceptFileSize, highlyAvailable}
|
||||
@@ -245,7 +245,7 @@ newChatController
|
||||
chatActivated <- newTVarIO True
|
||||
showLiveItems <- newTVarIO False
|
||||
encryptLocalFiles <- newTVarIO False
|
||||
tempDirectory <- newTVarIO Nothing
|
||||
tempDirectory <- newTVarIO optTempDirectory
|
||||
contactMergeEnabled <- newTVarIO True
|
||||
pqExperimentalEnabled <- newTVarIO PQSupportOff
|
||||
pure
|
||||
|
||||
@@ -207,6 +207,7 @@ mobileChatOpts dbFilePrefix =
|
||||
chatCmdLog = CCLNone,
|
||||
chatServerPort = Nothing,
|
||||
optFilesFolder = Nothing,
|
||||
optTempDirectory = Nothing,
|
||||
showReactions = False,
|
||||
allowInstantFiles = True,
|
||||
autoAcceptFileSize = 0,
|
||||
|
||||
@@ -41,6 +41,7 @@ data ChatOpts = ChatOpts
|
||||
chatCmdLog :: ChatCmdLog,
|
||||
chatServerPort :: Maybe String,
|
||||
optFilesFolder :: Maybe FilePath,
|
||||
optTempDirectory :: Maybe FilePath,
|
||||
showReactions :: Bool,
|
||||
allowInstantFiles :: Bool,
|
||||
autoAcceptFileSize :: Integer,
|
||||
@@ -258,6 +259,13 @@ chatOptsP appDir defaultDbFileName = do
|
||||
<> metavar "FOLDER"
|
||||
<> help "Folder to use for sent and received files"
|
||||
)
|
||||
optTempDirectory <-
|
||||
optional $
|
||||
strOption
|
||||
( long "temp-folder"
|
||||
<> metavar "FOLDER"
|
||||
<> help "Folder for temporary encrypted files (default: system temp directory)"
|
||||
)
|
||||
showReactions <-
|
||||
switch
|
||||
( long "reactions"
|
||||
@@ -304,6 +312,7 @@ chatOptsP appDir defaultDbFileName = do
|
||||
chatCmdLog,
|
||||
chatServerPort,
|
||||
optFilesFolder,
|
||||
optTempDirectory,
|
||||
showReactions,
|
||||
allowInstantFiles,
|
||||
autoAcceptFileSize,
|
||||
|
||||
@@ -74,6 +74,7 @@ testOpts =
|
||||
chatCmdLog = CCLNone,
|
||||
chatServerPort = Nothing,
|
||||
optFilesFolder = Nothing,
|
||||
optTempDirectory = Nothing,
|
||||
showReactions = True,
|
||||
allowInstantFiles = True,
|
||||
autoAcceptFileSize = 0,
|
||||
|
||||
Reference in New Issue
Block a user