From 40e717e7f4367e62f8b379f1dd314582197fa80a Mon Sep 17 00:00:00 2001 From: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:39:19 +0300 Subject: [PATCH] read conn networkStatus --- src/Simplex/Chat.hs | 2 ++ src/Simplex/Chat/Controller.hs | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 4530f59f37..a5ba74c9f8 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2189,10 +2189,12 @@ processChatCommand' vr = \case RcvFileConnection {entityConnection} -> pure entityConnection UserContactConnection {entityConnection} -> pure entityConnection deliveryStatus <- mapM readTVarIO . M.lookup acId =<< readTVarIO =<< asks agentDeliveryStatuses + networkStatus <- M.lookup acId <$> chatReadVar connNetworkStatuses pure $ CRDebugConnection DebugConnectionStatus { deliveryStatus, + networkStatus, inActive, inPending, server = (decodeLatin1 $ strEncode host, port), diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 74e1dda0f6..d54ac52d48 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -777,6 +777,7 @@ data ChatResponse data DebugConnectionStatus = DebugConnectionStatus { deliveryStatus :: Maybe AgentDeliveryStatus, + networkStatus :: Maybe NetworkStatus, -- from agent's TRecvQ via rcvId inActive :: Bool, -- should the delivery work right now? inPending :: Bool, -- is there a temporary error? @@ -792,9 +793,6 @@ data DebugConnectionStatus = DebugConnectionStatus } deriving (Show) --- XXX: attach NetworkConfig ? --- TransportSessionMode ? - -- some of these can only be used as command responses allowRemoteEvent :: ChatResponse -> Bool allowRemoteEvent = \case