From 72611084d3a4f3459bd672f6d65b071f2647315e Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Tue, 9 Apr 2024 17:31:52 +0100 Subject: [PATCH] core: debug events (#4006) --- src/Simplex/Chat.hs | 2 ++ src/Simplex/Chat/Controller.hs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 41f8828b26..a0f8d335a4 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2151,6 +2151,7 @@ processChatCommand' vr = \case CLGroup gId -> "Group " <> show gId CLUserContact ucId -> "UserContact " <> show ucId CLFile fId -> "File " <> show fId + DebugEvent event -> toView event >> ok_ GetAgentWorkers -> lift $ CRAgentWorkersSummary <$> withAgent' getAgentWorkersSummary GetAgentWorkersDetails -> lift $ CRAgentWorkersDetails <$> withAgent' getAgentWorkersDetails GetAgentStats -> lift $ CRAgentStats . map stat <$> withAgent' getAgentStats @@ -7225,6 +7226,7 @@ chatCommandP = ("/quit" <|> "/q" <|> "/exit") $> QuitChat, ("/version" <|> "/v") $> ShowVersion, "/debug locks" $> DebugLocks, + "/debug event " *> (DebugEvent <$> jsonP), "/get stats" $> GetAgentStats, "/reset stats" $> ResetAgentStats, "/get subs" $> GetAgentSubs, diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 5295541697..51b652d6d2 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -492,6 +492,7 @@ data ChatCommand | QuitChat | ShowVersion | DebugLocks + | DebugEvent ChatResponse | GetAgentStats | ResetAgentStats | GetAgentSubs