core: api to update user network state (#3998)

* core: api to update user network state

* simplexmq

* update simplexmq

* simplexmq
This commit is contained in:
Evgeny Poberezkin
2024-04-10 23:32:55 +01:00
committed by GitHub
parent 4be6c69633
commit b3a4ea8e57
4 changed files with 6 additions and 3 deletions
+2
View File
@@ -1277,6 +1277,7 @@ processChatCommand' vr = \case
APISetNetworkConfig cfg -> withUser' $ \_ -> lift (withAgent' (`setNetworkConfig` cfg)) >> ok_
APIGetNetworkConfig -> withUser' $ \_ ->
lift $ CRNetworkConfig <$> withAgent' getNetworkConfig
APISetNetworkInfo info -> lift (withAgent' (`setUserNetworkInfo` info)) >> ok_
ReconnectAllServers -> withUser' $ \_ -> lift (withAgent' reconnectAllServers) >> ok_
APISetChatSettings (ChatRef cType chatId) chatSettings -> withUser $ \user -> case cType of
CTDirect -> do
@@ -7046,6 +7047,7 @@ chatCommandP =
"/ttl " *> (SetChatItemTTL <$> ciTTL),
"/_ttl " *> (APIGetChatItemTTL <$> A.decimal),
"/ttl" $> GetChatItemTTL,
"/_network info " *> (APISetNetworkInfo <$> jsonP),
"/_network " *> (APISetNetworkConfig <$> jsonP),
("/network " <|> "/net ") *> (APISetNetworkConfig <$> netCfgP),
("/network" <|> "/net") $> APIGetNetworkConfig,