This commit is contained in:
Evgeny Poberezkin
2026-08-18 18:31:08 +01:00
parent 292cb97204
commit 85a5efb032
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -1697,8 +1697,7 @@ processChatCommand cxt nm = \case
Just RelayAddressLinkData {relayProfile} -> do
let failWithProfile step e =
pure $ CRChatRelayTestResult user (Just relayProfile) (Just $ RelayTestFailure step e)
-- only the compatibility of the URI matters here; the result was discarded
lift (withAgent' $ \a -> connRequestAgentVersion a cReq) >>= \case
lift (withAgent' (`connRequestAgentVersion` cReq)) >>= \case
Nothing -> failWithProfile RTSConnect (ChatError $ CERelayTestError "invalid connection request")
Just _ -> do
let chatV = initialChatVersion
@@ -3767,7 +3766,7 @@ processChatCommand cxt nm = \case
connectViaInvitation user@User {userId} incognito (CCLink cReq@(CRInvitationUri crData e2e) sLnk_) contactId_ =
withInvitationLock "connect" (strEncode cReq) $ do
subMode <- chatReadVar subscriptionMode
lift (withAgent' $ \a -> connRequestAgentVersion a cReq) >>= \case
lift (withAgent' (`connRequestAgentVersion` cReq)) >>= \case
Nothing -> throwChatError CEInvalidConnReq
-- TODO PQ the error above should be CEIncompatibleConnReqVersion, also the same API should be called in Plan
Just _ -> do
@@ -3937,7 +3936,7 @@ processChatCommand cxt nm = \case
-- Case 2 (address does not support PQ) is unreachable now that the agent floor
-- is 6 and the e2e range is 3..3: every peer we accept supports PQ, so only the
-- compatibility of the URI is still worth asking about.
lift (withAgent' $ \a -> connRequestAgentVersion a cReq) >>= \case
lift (withAgent' (`connRequestAgentVersion` cReq)) >>= \case
Nothing -> throwChatError CEInvalidConnReq
Just _ -> do
let chatV = initialChatVersion
@@ -4267,7 +4266,7 @@ processChatCommand cxt nm = \case
addRelay :: UserChatRelay -> CM (UserChatRelay, Either ChatError GroupRelay)
addRelay relay@UserChatRelay {address} = fmap (relay,) . tryAllErrors $ do
(_, _, cReq) <- getShortLinkConnReq nm user address
lift (withAgent' $ \a -> connRequestAgentVersion a cReq) >>= \case
lift (withAgent' (`connRequestAgentVersion` cReq)) >>= \case
Nothing -> throwChatError CEInvalidConnReq
Just _ -> do
let chatV = initialChatVersion
+1 -1
View File
@@ -1205,7 +1205,7 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage =
-- agent floor at 6 and the e2e range at 3..3, PQ is always supported,
-- so the only thing left to learn here is whether the URI is
-- compatible at all. The result was already discarded below.
lift (withAgent' $ \a -> connRequestAgentVersion a cReq) >>= \case
lift (withAgent' (`connRequestAgentVersion` cReq)) >>= \case
Nothing -> throwChatError CEInvalidConnReq
Just _ -> do
let chatV = initialChatVersion