From ade8590c887e512dcbc976adff5cb5433e66850d Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Fri, 3 Jul 2026 15:00:48 +0100 Subject: [PATCH] fix build --- src/Simplex/Chat/Library/Internal.hs | 30 +++++++++++++------------- src/Simplex/Chat/Library/Subscriber.hs | 18 ++++++++-------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Simplex/Chat/Library/Internal.hs b/src/Simplex/Chat/Library/Internal.hs index 11090e2f1a..a3a5ea8b87 100644 --- a/src/Simplex/Chat/Library/Internal.hs +++ b/src/Simplex/Chat/Library/Internal.hs @@ -935,8 +935,8 @@ acceptContactRequestAsync forM_ xContactId $ \xcId -> liftIO $ setContactAcceptedXContactId db ct xcId Connection {connId} <- liftIO $ createAcceptedContactConn db user (Just uclId) contactId acId chatV cReqChatVRange cReqPQSup incognitoProfile subMode currentTs liftIO $ setCommandConnId db user cmdId connId - getContact db vr user contactId - agentAcceptContactAsync user cmdId acId True cReqInvId (XInfo profileToSend) cReqPQSup chatV subMode + getContact db cxt user contactId + agentAcceptContactAsync cmdId acId True cReqInvId (XInfo profileToSend) cReqPQSup chatV subMode pure ct' acceptGroupJoinRequestAsync :: User -> Int64 -> GroupInfo -> InvitationId -> VersionRangeChat -> Profile -> Maybe XContactId -> Maybe MemberId -> Maybe SharedMsgId -> GroupAcceptance -> GroupMemberRole -> Maybe IncognitoProfile -> Maybe MemberKey -> Maybe GroupMember -> CM GroupMember @@ -988,8 +988,8 @@ acceptGroupJoinRequestAsync (cmdId, acId) <- prepareAgentAccept user True cReqInvId PQSupportOff m <- withStore $ \db -> do liftIO $ createJoiningMemberConnection db user uclId (cmdId, acId) chatV cReqChatVRange groupMemberId subMode - getGroupMemberById db vr user groupMemberId - agentAcceptContactAsync user cmdId acId True cReqInvId msg PQSupportOff chatV subMode + getGroupMemberById db cxt user groupMemberId + agentAcceptContactAsync cmdId acId True cReqInvId msg PQSupportOff chatV subMode pure m acceptGroupJoinSendRejectAsync :: User -> Int64 -> GroupInfo -> InvitationId -> VersionRangeChat -> Profile -> Maybe XContactId -> GroupRejectionReason -> CM GroupMember @@ -1020,8 +1020,8 @@ acceptGroupJoinSendRejectAsync (cmdId, acId) <- prepareAgentAccept user False cReqInvId PQSupportOff m <- withStore $ \db -> do liftIO $ createJoiningMemberConnection db user uclId (cmdId, acId) chatV cReqChatVRange groupMemberId subMode - getGroupMemberById db vr user groupMemberId - agentAcceptContactAsync user cmdId acId False cReqInvId msg PQSupportOff chatV subMode + getGroupMemberById db cxt user groupMemberId + agentAcceptContactAsync cmdId acId False cReqInvId msg PQSupportOff chatV subMode pure m acceptBusinessJoinRequestAsync :: User -> Int64 -> GroupInfo -> GroupMember -> UserContactRequest -> CM (GroupInfo, GroupMember) @@ -1055,7 +1055,7 @@ acceptBusinessJoinRequestAsync withStore' $ \db -> do forM_ xContactId $ \xcId -> setBusinessChatAcceptedXContactId db gInfo xcId createJoiningMemberConnection db user uclId (cmdId, acId) chatV cReqChatVRange groupMemberId subMode - agentAcceptContactAsync user cmdId acId True cReqInvId msg PQSupportOff chatV subMode + agentAcceptContactAsync cmdId acId True cReqInvId msg PQSupportOff chatV subMode let cd = CDGroupSnd gInfo Nothing -- TODO [short links] move to profileContactRequest? createInternalChatItem user cd (CISndGroupE2EEInfo $ e2eInfoGroup gInfo) Nothing @@ -1084,7 +1084,7 @@ acceptRelayJoinRequestAsync gInfo' <- liftIO $ updateRelayOwnStatusFromTo db gInfo RSInvited RSAccepted ownerMember' <- getGroupMemberById db cxt user groupMemberId pure (gInfo', ownerMember') - agentAcceptContactAsync user cmdId acId True cReqInvId msg PQSupportOff chatV subMode + agentAcceptContactAsync cmdId acId True cReqInvId msg PQSupportOff chatV subMode pure r rejectRelayInvitationAsync @@ -1108,7 +1108,7 @@ rejectRelayInvitationAsync user uclId cxt groupRelayInv invId reqChatVRange init (cmdId, acId) <- prepareAgentAccept user False invId PQSupportOff withStore' $ \db -> createJoiningMemberConnection db user uclId (cmdId, acId) chatV reqChatVRange groupMemberId subMode - agentAcceptContactAsync user cmdId acId False invId msg PQSupportOff chatV subMode + agentAcceptContactAsync cmdId acId False invId msg PQSupportOff chatV subMode businessGroupProfile :: Profile -> GroupPreferences -> GroupProfile businessGroupProfile Profile {displayName, fullName, shortDescr, image} groupPreferences = @@ -2749,8 +2749,8 @@ prepareAgentCreation user cmdFunction enableNtfs cMode = do connId <- withAgent $ \a -> prepareConnectionToCreate a (aUserId user) enableNtfs cMode PQSupportOff pure (cmdId, connId) -createAgentConnectionAsync :: ConnectionModeI c => User -> CommandId -> ConnId -> Bool -> SConnectionMode c -> SubscriptionMode -> CM () -createAgentConnectionAsync user cmdId connId enableNtfs cMode subMode = +createAgentConnectionAsync :: ConnectionModeI c => CommandId -> ConnId -> Bool -> SConnectionMode c -> SubscriptionMode -> CM () +createAgentConnectionAsync cmdId connId enableNtfs cMode subMode = withAgent $ \a -> createConnectionAsync a (aCorrId cmdId) connId enableNtfs cMode IKPQOff subMode prepareAgentJoin :: User -> Maybe Connection -> Bool -> ConnectionRequestUri c -> CM (CommandId, ConnId) @@ -2761,8 +2761,8 @@ 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 cmdId updateConn connId enableNtfs cReqUri cInfo subMode = +joinAgentConnectionAsync :: ConnectionModeI c => CommandId -> Bool -> ConnId -> Bool -> ConnectionRequestUri c -> ConnInfo -> SubscriptionMode -> CM () +joinAgentConnectionAsync cmdId updateConn connId enableNtfs cReqUri cInfo subMode = withAgent $ \a -> joinConnectionAsync a (aCorrId cmdId) updateConn connId enableNtfs cReqUri cInfo PQSupportOff subMode allowAgentConnectionAsync :: MsgEncodingI e => User -> Connection -> ConfirmationId -> ChatMsgEvent e -> CM () @@ -2778,8 +2778,8 @@ prepareAgentAccept user enableNtfs invId pqSup = do connId <- withAgent $ \a -> prepareConnectionToAccept a (aUserId user) enableNtfs invId pqSup pure (cmdId, connId) -agentAcceptContactAsync :: MsgEncodingI e => User -> CommandId -> ConnId -> Bool -> InvitationId -> ChatMsgEvent e -> PQSupport -> VersionChat -> SubscriptionMode -> CM () -agentAcceptContactAsync user cmdId connId enableNtfs invId msg pqSup chatV subMode = do +agentAcceptContactAsync :: MsgEncodingI e => CommandId -> ConnId -> Bool -> InvitationId -> ChatMsgEvent e -> PQSupport -> VersionChat -> SubscriptionMode -> CM () +agentAcceptContactAsync cmdId connId enableNtfs invId msg pqSup chatV subMode = do dm <- encodeConnInfoPQ pqSup chatV msg withAgent $ \a -> acceptContactAsync a (aCorrId cmdId) connId enableNtfs invId dm pqSup subMode diff --git a/src/Simplex/Chat/Library/Subscriber.hs b/src/Simplex/Chat/Library/Subscriber.hs index 19c6a55927..9099cf5a85 100644 --- a/src/Simplex/Chat/Library/Subscriber.hs +++ b/src/Simplex/Chat/Library/Subscriber.hs @@ -642,7 +642,7 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = groupConnIds <- prepareAgentCreation user CFCreateConnGrpInv True SCMInvitation gVar <- asks random withStore $ \db -> createNewContactMemberAsync db gVar user groupInfo ct' gLinkMemRole groupConnIds connChatVersion peerChatVRange subMode - uncurry (createAgentConnectionAsync user) groupConnIds True SCMInvitation subMode + uncurry createAgentConnectionAsync groupConnIds True SCMInvitation subMode -- TODO REMOVE LEGACY ^^^ SENT msgId proxy -> do void $ continueSending connEntity conn @@ -1242,8 +1242,8 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = profileToSend <- presentUserBadge user incognitoProfile $ userProfileInGroup user gInfo incognitoProfile dm <- encodeXMemberConnInfo gInfo relayMemberId profileToSend subMode <- chatReadVar subscriptionMode - (cmdId, connId) <- prepareAgentJoin user (Just conn) True cReq - joinAgentConnectionAsync user cmdId True connId True cReq dm subMode + (cmdId, connId') <- prepareAgentJoin user (Just conn) True cReq + joinAgentConnectionAsync cmdId True connId' True cReq dm subMode CFGetRelayDataAccept -> do let GroupMember {memberId = MemberId expectedMemberId} = m if linkEntityId == Just expectedMemberId @@ -1645,7 +1645,7 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = withStore $ \db -> do Connection {connId = testCId} <- createRelayTestConnection db cxt user acId ConnAccepted chatV subMode liftIO $ setCommandConnId db user cmdId testCId - agentAcceptContactAsync user cmdId acId True invId msg PQSupportOff chatV subMode + agentAcceptContactAsync cmdId acId True invId msg PQSupportOff chatV subMode | otherwise = messageError "relay test sent to non-relay link" where User {userChatRelay} = user @@ -2617,7 +2617,7 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = createMemberConnectionAsync db user hostId connIds connChatVersion peerChatVRange subMode updateGroupMemberStatusById db userId hostId GSMemAccepted updateGroupMemberStatus db userId membership GSMemAccepted - joinAgentConnectionAsync user cmdId False acId True connRequest dm subMode + joinAgentConnectionAsync cmdId False acId True connRequest dm subMode toView $ CEvtUserAcceptedGroupSent user gInfo {membership = membership {memberStatus = GSMemAccepted}} (Just ct) else do let content = CIRcvGroupInvitation (CIGroupInvitation {groupId, groupMemberId, localDisplayName, groupProfile, status = CIGISPending}) memRole @@ -3184,7 +3184,7 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = void $ withStore $ \db -> do reMember <- createIntroReMember db cxt user gInfo memInfo memRestrictions createIntroReMemberConn db user m reMember chatV memInfo groupConnIds subMode - uncurry (createAgentConnectionAsync user) groupConnIds (chatHasNtfs chatSettings) SCMInvitation subMode + uncurry createAgentConnectionAsync groupConnIds (chatHasNtfs chatSettings) SCMInvitation subMode | otherwise -> messageError "x.grp.mem.intro: member chat version range incompatible" _ -> messageError "x.grp.mem.intro can be only sent by host member" where @@ -3238,9 +3238,9 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = mcvr = maybe chatInitialVRange fromChatVRange memChatVRange chatV = vr cxt `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 gCmdId False gAcId enableNtfsGrp groupConnReq dm subMode forM_ ((,) <$> directConnIds <*> directConnReq) $ \((dCmdId, dAcId), dcr) -> - joinAgentConnectionAsync user dCmdId False dAcId True dcr dm subMode + joinAgentConnectionAsync dCmdId False dAcId True dcr dm subMode -- rollback defense (channels): apply an owner-signed role/removal only at a version >= the persisted -- roster_version (not the batch-constant gInfo, which a relay can stale by reordering events in one @@ -3760,7 +3760,7 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = p <- presentUserBadge user (incognitoMembershipProfile g) $ userProfileDirect user (fromLocalProfile <$> incognitoMembershipProfile g) Nothing True -- TODO PQ should negotitate contact connection with PQSupportOn? (use encodeConnInfoPQ) dm <- encodeConnInfo $ XInfo p - joinAgentConnectionAsync user cmdId False acId True connReq dm subMode + joinAgentConnectionAsync cmdId False acId True connReq dm subMode createItems mCt' m' = do (g', m'', scopeInfo) <- mkGroupChatScope g m' createInternalChatItem user (CDGroupRcv g' scopeInfo m'') (CIRcvGroupEvent RGEMemberCreatedContact) Nothing