mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
directory: command to disable all spam filters (#5709)
* directory: command to disable all spam filters * correct syntax * move deviceName to core opts
This commit is contained in:
parent
3425bd0826
commit
8c7df76c24
8 changed files with 14 additions and 16 deletions
|
@ -75,7 +75,6 @@ mkChatOpts :: BroadcastBotOpts -> ChatOpts
|
||||||
mkChatOpts BroadcastBotOpts {coreOptions} =
|
mkChatOpts BroadcastBotOpts {coreOptions} =
|
||||||
ChatOpts
|
ChatOpts
|
||||||
{ coreOptions,
|
{ coreOptions,
|
||||||
deviceName = Nothing,
|
|
||||||
chatCmd = "",
|
chatCmd = "",
|
||||||
chatCmdDelay = 3,
|
chatCmdDelay = 3,
|
||||||
chatCmdLog = CCLNone,
|
chatCmdLog = CCLNone,
|
||||||
|
|
|
@ -235,7 +235,7 @@ directoryCmdP =
|
||||||
acceptancePresetsP =
|
acceptancePresetsP =
|
||||||
spacesP
|
spacesP
|
||||||
*> A.choice
|
*> A.choice
|
||||||
[ "no" $> noJoinFilter,
|
[ "off" $> noJoinFilter,
|
||||||
"basic" $> basicJoinFilter,
|
"basic" $> basicJoinFilter,
|
||||||
("moderate" <|> "mod") $> moderateJoinFilter,
|
("moderate" <|> "mod") $> moderateJoinFilter,
|
||||||
"strong" $> strongJoinFilter
|
"strong" $> strongJoinFilter
|
||||||
|
|
|
@ -158,7 +158,6 @@ mkChatOpts :: DirectoryOpts -> ChatOpts
|
||||||
mkChatOpts DirectoryOpts {coreOptions} =
|
mkChatOpts DirectoryOpts {coreOptions} =
|
||||||
ChatOpts
|
ChatOpts
|
||||||
{ coreOptions,
|
{ coreOptions,
|
||||||
deviceName = Nothing,
|
|
||||||
chatCmd = "",
|
chatCmd = "",
|
||||||
chatCmdDelay = 3,
|
chatCmdDelay = 3,
|
||||||
chatCmdLog = CCLNone,
|
chatCmdLog = CCLNone,
|
||||||
|
|
|
@ -719,7 +719,7 @@ directoryServiceEvent st opts@DirectoryOpts {adminUsers, superUsers, serviceName
|
||||||
"",
|
"",
|
||||||
-- "Use */filter " <> tshow gId <> " <level>* to change spam filter level: no (disable), basic, moderate, strong.",
|
-- "Use */filter " <> tshow gId <> " <level>* to change spam filter level: no (disable), basic, moderate, strong.",
|
||||||
-- "Or use */filter " <> tshow gId <> " [name[=noimage]] [captcha[=noimage]] [observer[=noimage]]* for advanced filter configuration."
|
-- "Or use */filter " <> tshow gId <> " [name[=noimage]] [captcha[=noimage]] [observer[=noimage]]* for advanced filter configuration."
|
||||||
"Or use */filter " <> tshow gId <> " [name] [captcha]* to configure filter."
|
"Use */filter " <> tshow gId <> " [name] [captcha]* to enable and */filter " <> tshow gId <> " off* to disable filter."
|
||||||
]
|
]
|
||||||
showCondition = \case
|
showCondition = \case
|
||||||
Nothing -> "_disabled_"
|
Nothing -> "_disabled_"
|
||||||
|
|
|
@ -194,7 +194,7 @@ newChatController
|
||||||
ChatDatabase {chatStore, agentStore}
|
ChatDatabase {chatStore, agentStore}
|
||||||
user
|
user
|
||||||
cfg@ChatConfig {agentConfig = aCfg, presetServers, inlineFiles, deviceNameForRemote, confirmMigrations}
|
cfg@ChatConfig {agentConfig = aCfg, presetServers, inlineFiles, deviceNameForRemote, confirmMigrations}
|
||||||
ChatOpts {coreOptions = CoreChatOpts {smpServers, xftpServers, simpleNetCfg, logLevel, logConnections, logServerHosts, logFile, tbqSize, highlyAvailable, yesToUpMigrations}, deviceName, optFilesFolder, optTempDirectory, showReactions, allowInstantFiles, autoAcceptFileSize}
|
ChatOpts {coreOptions = CoreChatOpts {smpServers, xftpServers, simpleNetCfg, logLevel, logConnections, logServerHosts, logFile, tbqSize, deviceName, highlyAvailable, yesToUpMigrations}, optFilesFolder, optTempDirectory, showReactions, allowInstantFiles, autoAcceptFileSize}
|
||||||
backgroundMode = do
|
backgroundMode = do
|
||||||
let inlineFiles' = if allowInstantFiles || autoAcceptFileSize > 0 then inlineFiles else inlineFiles {sendChunks = 0, receiveInstant = False}
|
let inlineFiles' = if allowInstantFiles || autoAcceptFileSize > 0 then inlineFiles else inlineFiles {sendChunks = 0, receiveInstant = False}
|
||||||
confirmMigrations' = if confirmMigrations == MCConsole && yesToUpMigrations then MCYesUp else confirmMigrations
|
confirmMigrations' = if confirmMigrations == MCConsole && yesToUpMigrations then MCYesUp else confirmMigrations
|
||||||
|
|
|
@ -204,10 +204,10 @@ mobileChatOpts dbOptions =
|
||||||
logAgent = Nothing,
|
logAgent = Nothing,
|
||||||
logFile = Nothing,
|
logFile = Nothing,
|
||||||
tbqSize = 4096,
|
tbqSize = 4096,
|
||||||
|
deviceName = Nothing,
|
||||||
highlyAvailable = False,
|
highlyAvailable = False,
|
||||||
yesToUpMigrations = False
|
yesToUpMigrations = False
|
||||||
},
|
},
|
||||||
deviceName = Nothing,
|
|
||||||
chatCmd = "",
|
chatCmd = "",
|
||||||
chatCmdDelay = 3,
|
chatCmdDelay = 3,
|
||||||
chatCmdLog = CCLNone,
|
chatCmdLog = CCLNone,
|
||||||
|
|
|
@ -38,7 +38,6 @@ import Simplex.Chat.Options.DB
|
||||||
|
|
||||||
data ChatOpts = ChatOpts
|
data ChatOpts = ChatOpts
|
||||||
{ coreOptions :: CoreChatOpts,
|
{ coreOptions :: CoreChatOpts,
|
||||||
deviceName :: Maybe Text,
|
|
||||||
chatCmd :: String,
|
chatCmd :: String,
|
||||||
chatCmdDelay :: Int,
|
chatCmdDelay :: Int,
|
||||||
chatCmdLog :: ChatCmdLog,
|
chatCmdLog :: ChatCmdLog,
|
||||||
|
@ -64,6 +63,7 @@ data CoreChatOpts = CoreChatOpts
|
||||||
logAgent :: Maybe LogLevel,
|
logAgent :: Maybe LogLevel,
|
||||||
logFile :: Maybe FilePath,
|
logFile :: Maybe FilePath,
|
||||||
tbqSize :: Natural,
|
tbqSize :: Natural,
|
||||||
|
deviceName :: Maybe Text,
|
||||||
highlyAvailable :: Bool,
|
highlyAvailable :: Bool,
|
||||||
yesToUpMigrations :: Bool
|
yesToUpMigrations :: Bool
|
||||||
}
|
}
|
||||||
|
@ -212,6 +212,13 @@ coreChatOptsP appDir defaultDbName = do
|
||||||
<> value 1024
|
<> value 1024
|
||||||
<> showDefault
|
<> showDefault
|
||||||
)
|
)
|
||||||
|
deviceName <-
|
||||||
|
optional $
|
||||||
|
strOption
|
||||||
|
( long "device-name"
|
||||||
|
<> metavar "DEVICE"
|
||||||
|
<> help "Device name to use in connections with remote hosts and controller"
|
||||||
|
)
|
||||||
highlyAvailable <-
|
highlyAvailable <-
|
||||||
switch
|
switch
|
||||||
( long "ha"
|
( long "ha"
|
||||||
|
@ -246,6 +253,7 @@ coreChatOptsP appDir defaultDbName = do
|
||||||
logAgent = if logAgent || logLevel == CLLDebug then Just $ agentLogLevel logLevel else Nothing,
|
logAgent = if logAgent || logLevel == CLLDebug then Just $ agentLogLevel logLevel else Nothing,
|
||||||
logFile,
|
logFile,
|
||||||
tbqSize,
|
tbqSize,
|
||||||
|
deviceName,
|
||||||
highlyAvailable,
|
highlyAvailable,
|
||||||
yesToUpMigrations
|
yesToUpMigrations
|
||||||
}
|
}
|
||||||
|
@ -260,13 +268,6 @@ defaultHostMode = \case
|
||||||
chatOptsP :: FilePath -> FilePath -> Parser ChatOpts
|
chatOptsP :: FilePath -> FilePath -> Parser ChatOpts
|
||||||
chatOptsP appDir defaultDbName = do
|
chatOptsP appDir defaultDbName = do
|
||||||
coreOptions <- coreChatOptsP appDir defaultDbName
|
coreOptions <- coreChatOptsP appDir defaultDbName
|
||||||
deviceName <-
|
|
||||||
optional $
|
|
||||||
strOption
|
|
||||||
( long "device-name"
|
|
||||||
<> metavar "DEVICE"
|
|
||||||
<> help "Device name to use in connections with remote hosts and controller"
|
|
||||||
)
|
|
||||||
chatCmd <-
|
chatCmd <-
|
||||||
strOption
|
strOption
|
||||||
( long "execute"
|
( long "execute"
|
||||||
|
@ -356,7 +357,6 @@ chatOptsP appDir defaultDbName = do
|
||||||
pure
|
pure
|
||||||
ChatOpts
|
ChatOpts
|
||||||
{ coreOptions,
|
{ coreOptions,
|
||||||
deviceName,
|
|
||||||
chatCmd,
|
chatCmd,
|
||||||
chatCmdDelay,
|
chatCmdDelay,
|
||||||
chatCmdLog,
|
chatCmdLog,
|
||||||
|
|
|
@ -94,7 +94,6 @@ testOpts :: ChatOpts
|
||||||
testOpts =
|
testOpts =
|
||||||
ChatOpts
|
ChatOpts
|
||||||
{ coreOptions = testCoreOpts,
|
{ coreOptions = testCoreOpts,
|
||||||
deviceName = Nothing,
|
|
||||||
chatCmd = "",
|
chatCmd = "",
|
||||||
chatCmdDelay = 3,
|
chatCmdDelay = 3,
|
||||||
chatCmdLog = CCLNone,
|
chatCmdLog = CCLNone,
|
||||||
|
@ -135,6 +134,7 @@ testCoreOpts =
|
||||||
logAgent = Nothing,
|
logAgent = Nothing,
|
||||||
logFile = Nothing,
|
logFile = Nothing,
|
||||||
tbqSize = 16,
|
tbqSize = 16,
|
||||||
|
deviceName = Nothing,
|
||||||
highlyAvailable = False,
|
highlyAvailable = False,
|
||||||
yesToUpMigrations = False
|
yesToUpMigrations = False
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue