read conn networkStatus

This commit is contained in:
Alexander Bondarenko
2024-04-26 17:39:19 +03:00
parent 97bdb9484b
commit 40e717e7f4
2 changed files with 3 additions and 3 deletions
+2
View File
@@ -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),
+1 -3
View File
@@ -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