This commit is contained in:
Evgeny @ SimpleX Chat
2026-06-29 11:36:37 +00:00
parent e5f2fb0654
commit b6944d73d1
2 changed files with 11 additions and 1 deletions
+7
View File
@@ -4305,6 +4305,7 @@ processChatCommand cxt nm = \case
case plan of
CPContactAddress (CAPContactViaAddress Contact {contactId}) ->
processChatCommand cxt nm $ APIConnectContactViaAddress userId incognito contactId
CPContactAddress (CAPOk (Just sld) _ vName@(Just _)) -> connectContactViaName sld vName
CPGroupLink (GLPOk (Just GroupShortLinkInfo {direct = False}) (Just gld) _ vName)
| ACCL SCMContact ccl <- ccLink -> joinChannelViaRelays ccl gld vName
_ -> processChatCommand cxt nm $ APIConnect userId incognito $ Just ccLink
@@ -4326,6 +4327,12 @@ processChatCommand cxt nm = \case
gInfo <- withFastStore $ \db -> getGroupInfo db cxt user groupId
deleteGroupConnections user gInfo False
withFastStore' $ \db -> deleteGroup db user gInfo
connectContactViaName :: ContactShortLinkData -> Maybe SimplexNameInfo -> CM ChatResponse
connectContactViaName sld vName =
processChatCommand cxt nm (APIPrepareContact userId ccLink sld vName) >>= \case
CRNewPreparedChat _ (AChat SCTDirect (Chat (DirectChat Contact {contactId}) _ _)) ->
processChatCommand cxt nm (APIConnectPreparedContact contactId incognito Nothing)
_ -> throwChatError $ CEException "connectContactViaName: unexpected response from APIPrepareContact"
invitationRequestPlan :: User -> ConnReqInvitation -> Maybe ContactShortLinkData -> Maybe OwnerVerification -> CM ConnectionPlan
invitationRequestPlan user cReq cld ov = do
maybe (CPInvitationLink (ILPOk cld ov)) (invitationEntityPlan cld ov)
+4 -1
View File
@@ -31,7 +31,10 @@ testConnectByName ps = withSmpServerAndNames $ \reg ->
alice ##> "/_set_name 1 @alice.simplex"
alice <## "new contact address set"
bob ##> "/c @alice.simplex"
alice <#? bob
bob <## "alice: connection started"
alice <## "bob (Bob) wants to connect to you!"
alice <## "to accept: /ac bob"
alice <## "to reject: /rc bob (the sender will NOT be notified)"
alice ##> "/ac bob"
alice <## "bob (Bob): accepting contact request, you can send messages to contact"
concurrently_