core: SMP server connection test (#1367)

* core: SMP server connection test

* fix test

* update simplexmq
This commit is contained in:
Evgeny Poberezkin
2022-11-15 18:31:29 +00:00
committed by GitHub
parent fd34c39552
commit f8302e2030
8 changed files with 42 additions and 9 deletions
+5
View File
@@ -675,6 +675,7 @@ processChatCommand = \case
ChatConfig {defaultServers = InitialAgentServers {smp = defaultSMPServers}} <- asks config
withAgent $ \a -> setSMPServers a (fromMaybe defaultSMPServers (nonEmpty smpServers))
pure CRCmdOk
TestSMPServer smpServer -> CRSMPTestResult <$> withAgent (`testSMPServerConnection` smpServer)
APISetChatItemTTL newTTL_ -> withUser' $ \user ->
checkStoreNotChanged $
withChatLock "setChatItemTTL" $ do
@@ -3203,6 +3204,10 @@ chatCommandP =
"/smp_servers default" $> SetUserSMPServers [],
"/smp_servers " *> (SetUserSMPServers <$> smpServersP),
"/smp_servers" $> GetUserSMPServers,
"/smp default" $> SetUserSMPServers [],
"/smp test " *> (TestSMPServer <$> strP),
"/smp " *> (SetUserSMPServers <$> smpServersP),
"/smp" $> GetUserSMPServers,
"/_ttl " *> (APISetChatItemTTL <$> ciTTLDecimal),
"/ttl " *> (APISetChatItemTTL <$> ciTTL),
"/ttl" $> APIGetChatItemTTL,