directory: support public channels and relay-based groups (#6840)

* directory: support public channels and relay-based groups (plan)

* types

* amend types

* directory types, resolve known link

* implementation, test fails

* fix test

* fix test

* more test

* minimal test

* more test

* debug test

* clean up

* remove debug logs

* refactor

* use group/channel terms correctly

* remove unsupported commands

* manage profile update

* owner left the channel

* more tests, correct response to sent link

* re-registration

* /help and /link commands

* correct listing for channels

* fix test

* fix bot api

* refactor

* do not include link data in GLPKnown

* refactor

* diff

* undo refactor

* simplify

* remove harness test

* remove flip

* add v6.5 app requirement for channels

* add website support

* update bot api types

* correct member count, fix test

* members -> subscribers

* add link to channel description

* fix css

* move version note

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
Evgeny
2026-04-23 13:30:26 +01:00
committed by GitHub
co-authored by Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
parent a3fde4daa1
commit f3547878cc
19 changed files with 999 additions and 198 deletions
+9 -3
View File
@@ -470,13 +470,13 @@ data ChatCommand
| AddContact IncognitoEnabled
| APISetConnectionIncognito Int64 IncognitoEnabled
| APIChangeConnectionUser Int64 UserId -- new user id to switch connection to
| APIConnectPlan {userId :: UserId, connectionLink :: Maybe AConnectionLink, linkOwnerSig :: Maybe LinkOwnerSig} -- Maybe AConnectionLink is used to report link parsing failure as special error
| APIConnectPlan {userId :: UserId, connectionLink :: Maybe AConnectionLink, resolveKnown :: Bool, linkOwnerSig :: Maybe LinkOwnerSig} -- Maybe AConnectionLink is used to report link parsing failure as special error
| APIPrepareContact UserId ACreatedConnLink ContactShortLinkData
| APIPrepareGroup UserId CreatedLinkContact DirectLink GroupShortLinkData
| APIChangePreparedContactUser ContactId UserId
| APIChangePreparedGroupUser GroupId UserId
| APIConnectPreparedContact {contactId :: ContactId, incognito :: IncognitoEnabled, msgContent_ :: Maybe MsgContent}
| APIConnectPreparedGroup GroupId IncognitoEnabled (Maybe MsgContent)
| APIConnectPreparedGroup {groupId :: GroupId, incognito :: IncognitoEnabled, ownerContact :: Maybe GroupOwnerContact, msgContent_ :: Maybe MsgContent}
| APIConnect {userId :: UserId, incognito :: IncognitoEnabled, preparedLink_ :: Maybe ACreatedConnLink} -- Maybe is used to report link parsing failure as special error
| Connect {incognito :: IncognitoEnabled, connLink_ :: Maybe AConnectionLink}
| APIConnectContactViaAddress UserId IncognitoEnabled ContactId
@@ -1037,7 +1037,7 @@ data GroupLinkPlan
| GLPOwnLink {groupInfo :: GroupInfo}
| GLPConnectingConfirmReconnect
| GLPConnectingProhibit {groupInfo_ :: Maybe GroupInfo}
| GLPKnown {groupInfo :: GroupInfo}
| GLPKnown {groupInfo :: GroupInfo, groupUpdated :: Bool, ownerVerification :: Maybe OwnerVerification}
| GLPNoRelays {groupSLinkData_ :: Maybe GroupShortLinkData}
deriving (Show)
@@ -1046,6 +1046,12 @@ data OwnerVerification
| OVFailed {reason :: Text}
deriving (Show)
data GroupOwnerContact = GroupOwnerContact
{ contactId :: ContactId,
memberId :: MemberId
}
deriving (Show)
type DirectLink = Bool
data GroupShortLinkInfo = GroupShortLinkInfo