mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-11 13:15:05 +00:00
read conn networkStatus
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user