From 37eef3c6c99d69644650840c8a5b943eec839f79 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Wed, 6 Sep 2023 18:05:42 +0400 Subject: [PATCH] core: enable creation of direct connections in group (revert this instead of #3022) (#3025) --- src/Simplex/Chat.hs | 4 ++-- tests/ChatTests/Groups.hs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 84f6645f96..359e7f5b5d 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -3041,7 +3041,7 @@ processAgentMessageConn user@User {userId} corrId agentConnId agentMessage = do groupConnReq@(CRInvitationUri _ _) -> case cmdFunction of -- [async agent commands] XGrpMemIntro continuation on receiving INV CFCreateConnGrpMemInv - | isCompatibleRange (peerChatVRange conn) groupNoDirectVRange -> sendWithoutDirectCReq + | isCompatibleRange (peerChatVRange conn) groupNoDirectVRange -> sendWithDirectCReq -- sendWithoutDirectCReq | otherwise -> sendWithDirectCReq where sendWithoutDirectCReq = do @@ -4290,7 +4290,7 @@ processAgentMessageConn user@User {userId} corrId agentConnId agentMessage = do directConnIds <- case memberChatVRange of Nothing -> Just <$> createConn Just mcvr - | isCompatibleRange (fromChatVRange mcvr) groupNoDirectVRange -> pure Nothing + | isCompatibleRange (fromChatVRange mcvr) groupNoDirectVRange -> Just <$> createConn -- pure Nothing | otherwise -> Just <$> createConn let customUserProfileId = if memberIncognito membership then Just (localProfileId $ memberProfile membership) else Nothing void $ withStore $ \db -> createIntroReMember db user gInfo m memInfo groupConnIds directConnIds customUserProfileId diff --git a/tests/ChatTests/Groups.hs b/tests/ChatTests/Groups.hs index 23df9f460f..d476285fcd 100644 --- a/tests/ChatTests/Groups.hs +++ b/tests/ChatTests/Groups.hs @@ -68,17 +68,17 @@ chatGroupTests = do it "should send delivery receipts in group depending on configuration" testConfigureGroupDeliveryReceipts describe "direct connections in group are not established based on chat protocol version" $ do describe "3 members group" $ do - testNoDirect _0 _0 True - testNoDirect _0 _1 True + testNoDirect _0 _0 False -- True + testNoDirect _0 _1 False -- True testNoDirect _1 _0 False testNoDirect _1 _1 False describe "4 members group" $ do - testNoDirect4 _0 _0 _0 True True True - testNoDirect4 _0 _0 _1 True True True - testNoDirect4 _0 _1 _0 True True False - testNoDirect4 _0 _1 _1 True True False - testNoDirect4 _1 _0 _0 False False True - testNoDirect4 _1 _0 _1 False False True + testNoDirect4 _0 _0 _0 False False False -- True True True + testNoDirect4 _0 _0 _1 False False False -- True True True + testNoDirect4 _0 _1 _0 False False False -- True True False + testNoDirect4 _0 _1 _1 False False False -- True True False + testNoDirect4 _1 _0 _0 False False False -- False False True + testNoDirect4 _1 _0 _1 False False False -- False False True testNoDirect4 _1 _1 _0 False False False testNoDirect4 _1 _1 _1 False False False where