mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 12:04:11 +00:00
core: preserve domain during group handshake
This commit is contained in:
@@ -2721,7 +2721,11 @@ updateGroupProfile db user@User {userId} g@GroupInfo {groupId, localDisplayName,
|
||||
-- group_domain is owned by publicGroup; when the incoming profile has no publicGroup (a business, whose domain
|
||||
-- is set out-of-band) the CASE leaves the stored group_domain unchanged instead of clearing it.
|
||||
updateGroupProfile_ currentTs =
|
||||
let (groupWebPage_, groupDomain_, domainWebPage_, allowEmbedding_, groupDomainProof_) = publicGroupAccessRow publicGroup
|
||||
-- the wire carries the domain but not its signed proof (the group's link is authoritative for the claim), so
|
||||
-- keep the stored proof on an unchanged domain instead of overwriting it with the empty incoming one, the same
|
||||
-- way updateContactProfile preserves contactDomain's proof
|
||||
let (groupWebPage_, groupDomain_, domainWebPage_, allowEmbedding_, _) = publicGroupAccessRow publicGroup
|
||||
groupDomainProof_ = if claimChanged then Nothing else oldPublicGroup >>= publicGroupAccess >>= groupDomainClaim >>= proof
|
||||
in DB.execute
|
||||
db
|
||||
[sql|
|
||||
|
||||
@@ -1827,10 +1827,12 @@ viewContactInfo ct@Contact {contactId, profile = LocalProfile {localAlias, conta
|
||||
<> viewCustomData customData
|
||||
|
||||
viewGroupInfo :: GroupInfo -> [StyledString]
|
||||
viewGroupInfo gInfo@GroupInfo {groupId, uiThemes, customData, groupSummary = GroupSummary {currentMembers, publicMemberCount}} =
|
||||
viewGroupInfo gInfo@GroupInfo {groupId, businessChat, groupDomainVerified, uiThemes, customData, groupSummary = GroupSummary {currentMembers, publicMemberCount}} =
|
||||
[ "group ID: " <> sShow groupId,
|
||||
memberCountLine
|
||||
]
|
||||
-- a business presents as a contact, so its verified domain is shown as an @-name
|
||||
<> simplexDomainLine NTContact (businessDomain =<< businessChat) groupDomainVerified
|
||||
<> viewUITheme uiThemes
|
||||
<> viewCustomData customData
|
||||
where
|
||||
|
||||
@@ -239,5 +239,10 @@ testConnectByNameBusinessAndChannel ps = withSmpServerAndNames $ \reg ->
|
||||
bob ##> "/_connect plan 1 @biz.simplex resolve=never"
|
||||
bob <## "business address: known business #alice"
|
||||
bob <## "use #alice <message> to send messages"
|
||||
-- the business's verified domain survives the handshake and is shown in group info
|
||||
bob ##> "/i #alice"
|
||||
bob <## "group ID: 1"
|
||||
bob <## "current members: 2"
|
||||
bob <## "SimpleX name: @biz.simplex (verified)"
|
||||
where
|
||||
bizName = SimplexNameInfo NTContact (SimplexDomain TLDSimplex "biz" [])
|
||||
|
||||
Reference in New Issue
Block a user