diff --git a/cabal.project b/cabal.project index da46056668..1f3c134403 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: b8971a31bcb82fffabcb792c9afd6bc4a96ec649 + tag: 55afb3d092303f2d8e90fb52b3fc169e8a364ef0 source-repository-package type: git diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 314cb070f1..dd7a9b8a83 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."b8971a31bcb82fffabcb792c9afd6bc4a96ec649" = "1p6m390ngcsp7i7vy0m0zxh167gkbciavva9a00l6pxwzaz9qmpi"; + "https://github.com/simplex-chat/simplexmq.git"."55afb3d092303f2d8e90fb52b3fc169e8a364ef0" = "12pdj58ww1d24zywqw9liw87q7z7pd32g1a8z3s44k8c04sl9hqp"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d"; "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 87ea8809d2..0d3369a007 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -1787,8 +1787,8 @@ processChatCommand' vr = \case -- search connection by link (cReq) -- or, better, pass connId found by connectPlan? (Either AConnectionRequestUri DBConnectionId) connId <- withAgent $ \a -> prepareConnectionToJoin a (aUserId user) True cReq pqSup' - conn@PendingContactConnection {pccConnId} <- withFastStore' $ \db -> createDirectConnection db user connId cReq ConnJoined (incognitoProfile $> profileToSend) subMode chatV pqSup' - joinPreparedAgentConnection user pccConnId connId cReq dm pqSup' subMode + conn <- withFastStore' $ \db -> createDirectConnection db user connId cReq ConnJoined (incognitoProfile $> profileToSend) subMode chatV pqSup' + void $ withAgent $ \a -> joinConnection a (aUserId user) connId True cReq dm pqSup' subMode pure $ CRSentConfirmation user conn APIConnect userId incognito (Just (ACR SCMContact cReq)) -> withUserId userId $ \user -> connectViaContact user incognito cReq APIConnect _ _ Nothing -> throwChatError CEInvalidConnReq @@ -2054,7 +2054,7 @@ processChatCommand' vr = \case pure cId -- TODO conn prepare -- don't cleanup (set failure state? - same as for invitation links) - void (withAgent $ \a -> joinConnection a (aUserId user) (Just agentConnId) True connRequest dm PQSupportOff subMode) + void (withAgent $ \a -> joinConnection a (aUserId user) agentConnId True connRequest dm PQSupportOff subMode) `catchChatError` \e -> do withFastStore' $ \db -> do deleteConnectionRecord db user cId @@ -2630,15 +2630,7 @@ processChatCommand' vr = \case let profileToSend = userProfileToSend user incognitoProfile Nothing inGroup dm <- encodeConnInfoPQ pqSup chatV (XContact profileToSend $ Just xContactId) subMode <- chatReadVar subscriptionMode - joinPreparedAgentConnection user pccConnId connId cReq dm pqSup subMode - joinPreparedAgentConnection :: User -> Int64 -> ConnId -> ConnectionRequestUri m -> ByteString -> PQSupport -> SubscriptionMode -> CM () - joinPreparedAgentConnection user pccConnId connId cReq connInfo pqSup subMode = do - void (withAgent $ \a -> joinConnection a (aUserId user) (Just connId) True cReq connInfo pqSup subMode) - -- TODO conn prepare - -- if joining invitation connection: - -- don't cleanup connection on error - -- tbd - only joinConnection, or catch to mark error status? - -- if joining contact connection: keep cleanup? (there's no secure - api is misleading, it's not really a JOIN) + void (withAgent $ \a -> joinConnection a (aUserId user) connId True cReq dm pqSup subMode) `catchChatError` \e -> do withFastStore' $ \db -> deleteConnectionRecord db user pccConnId withAgent $ \a -> deleteConnectionAsync a False connId @@ -3696,7 +3688,9 @@ acceptContactRequest user UserContactRequest {agentInvitationId = AgentInvId inv chatV = vr `peerConnChatVersion` cReqChatVRange pqSup' = pqSup `CR.pqSupportAnd` pqSupport dm <- encodeConnInfoPQ pqSup' chatV $ XInfo profileToSend - (acId, sqSecured) <- withAgent $ \a -> acceptContact a True invId dm pqSup' subMode + -- TODO conn prepare + -- use prepared conn id + (acId, sqSecured) <- withAgent $ \a -> acceptContact a "" True invId dm pqSup' subMode let connStatus = if sqSecured then ConnSndReady else ConnNew withStore' $ \db -> createAcceptedContact db user acId connStatus chatV cReqChatVRange cName profileId cp userContactLinkId xContactId incognitoProfile subMode pqSup' contactUsed