core: prepare group link before creating the group (#6600)

* core: prepare group link before creating the group

* update group creation flow

* refactor

* comments

* update plan, schema, api docs/types

* store shared group ID and keys when joining relay groups

* query plans, api docs
This commit is contained in:
Evgeny
2026-01-27 17:56:31 +00:00
committed by GitHub
parent 31ea6ffe32
commit 7d5768cf3a
22 changed files with 371 additions and 156 deletions
+11 -2
View File
@@ -994,7 +994,7 @@ data ContactAddressPlan
deriving (Show)
data GroupLinkPlan
= GLPOk {direct :: DirectLink, groupSLinkData_ :: Maybe GroupShortLinkData}
= GLPOk {groupSLinkInfo_ :: Maybe GroupShortLinkInfo, groupSLinkData_ :: Maybe GroupShortLinkData}
| GLPOwnLink {groupInfo :: GroupInfo}
| GLPConnectingConfirmReconnect
| GLPConnectingProhibit {groupInfo_ :: Maybe GroupInfo}
@@ -1003,6 +1003,13 @@ data GroupLinkPlan
type DirectLink = Bool
data GroupShortLinkInfo = GroupShortLinkInfo
{ direct :: Bool,
groupRelays :: [ShortLinkContact],
sharedGroupId :: Maybe B64UrlByteString
}
deriving (Show)
connectionPlanProceed :: ConnectionPlan -> Bool
connectionPlanProceed = \case
CPInvitationLink ilp -> case ilp of
@@ -1016,7 +1023,7 @@ connectionPlanProceed = \case
CAPContactViaAddress _ -> True
_ -> False
CPGroupLink glp -> case glp of
GLPOk _direct _ -> True
GLPOk {} -> True
GLPOwnLink _ -> True
GLPConnectingConfirmReconnect -> True
_ -> False
@@ -1598,6 +1605,8 @@ $(JQ.deriveJSON (sumTypeJSON $ dropPrefix "ILP") ''InvitationLinkPlan)
$(JQ.deriveJSON (sumTypeJSON $ dropPrefix "CAP") ''ContactAddressPlan)
$(JQ.deriveJSON defaultJSON ''GroupShortLinkInfo)
$(JQ.deriveJSON (sumTypeJSON $ dropPrefix "GLP") ''GroupLinkPlan)
$(JQ.deriveJSON (sumTypeJSON $ dropPrefix "FC") ''ForwardConfirmation)