This commit is contained in:
Evgeny @ SimpleX Chat
2026-06-04 09:44:20 +00:00
parent 104c195624
commit 39cf4c24b9
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -2487,7 +2487,7 @@ msgContentHasLink mc ft_ = case msgContentTag mc of
MCLink_ -> True
_ -> maybe False hasLinks ft_
prepareAgentCreation :: ConnectionModeI c => User -> CommandFunction -> Bool -> SConnectionMode c -> CM (CommandId, ConnId)
prepareAgentCreation :: User -> CommandFunction -> Bool -> SConnectionMode c -> CM (CommandId, ConnId)
prepareAgentCreation user cmdFunction enableNtfs cMode = do
cmdId <- withStore' $ \db -> createCommand db user Nothing cmdFunction
connId <- withAgent $ \a -> prepareConnectionToCreate a (aUserId user) enableNtfs cMode PQSupportOff
@@ -2505,7 +2505,7 @@ prepareAgentJoin user conn_ enableNtfs cReqUri = do
Nothing -> withAgent $ \a -> prepareConnectionToJoin a (aUserId user) enableNtfs cReqUri PQSupportOff
pure (cmdId, connId)
joinAgentConnectionAsync :: ConnectionModeI c => User -> CommandId -> Bool -> ConnId -> Bool -> ConnectionRequestUri c -> ConnInfo -> SubscriptionMode -> CM ()
joinAgentConnectionAsync :: User -> CommandId -> Bool -> ConnId -> Bool -> ConnectionRequestUri c -> ConnInfo -> SubscriptionMode -> CM ()
joinAgentConnectionAsync user cmdId updateConn connId enableNtfs cReqUri cInfo subMode =
withAgent $ \a -> joinConnectionAsync a (aCorrId cmdId) updateConn connId enableNtfs cReqUri cInfo PQSupportOff subMode
+2 -3
View File
@@ -3104,14 +3104,13 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
allowSimplexLinks = groupFeatureUserAllowed SGFSimplexLinks gInfo
dm <- encodeConnInfo $ XGrpMemInfo membershipMemId membershipProfile
-- [async agent commands] no continuation needed, but commands should be asynchronous for stability
let enableNtfsGrp = chatHasNtfs chatSettings
groupConnIds@(gCmdId, gAcId) <- prepareAgentJoin user Nothing enableNtfsGrp groupConnReq
groupConnIds@(gCmdId, gAcId) <- prepareAgentJoin user Nothing (chatHasNtfs chatSettings) groupConnReq
directConnIds <- forM directConnReq $ \dcr -> prepareAgentJoin user Nothing True dcr
let customUserProfileId = localProfileId <$> incognitoMembershipProfile gInfo
mcvr = maybe chatInitialVRange fromChatVRange memChatVRange
chatV = vr `peerConnChatVersion` mcvr
withStore' $ \db -> createIntroToMemberContact db user m toMember chatV mcvr groupConnIds directConnIds customUserProfileId subMode
joinAgentConnectionAsync user gCmdId False gAcId enableNtfsGrp groupConnReq dm subMode
joinAgentConnectionAsync user gCmdId False gAcId (chatHasNtfs chatSettings) groupConnReq dm subMode
forM_ ((,) <$> directConnIds <*> directConnReq) $ \((dCmdId, dAcId), dcr) ->
joinAgentConnectionAsync user dCmdId False dAcId True dcr dm subMode