revert breaking field name change

This commit is contained in:
Evgeny Poberezkin
2026-07-01 17:35:51 +01:00
parent fbb171019f
commit c86bf5b3b4
8 changed files with 24 additions and 21 deletions
@@ -149,7 +149,7 @@ struct ChannelWebAccessView: View {
pg.publicGroupAccess = PublicGroupAccess(
groupWebPage: trimmedPage.isEmpty ? nil : trimmedPage,
simplexName: existingAccess?.simplexName,
simplexNameWebPage: existingAccess?.simplexNameWebPage ?? false,
domainWebPage: existingAccess?.domainWebPage ?? false,
allowEmbedding: allowEmbedding
)
gp.publicGroup = pg
+3 -3
View File
@@ -2621,16 +2621,16 @@ public enum GroupType: Codable, Hashable {
}
public struct PublicGroupAccess: Codable, Hashable {
public init(groupWebPage: String? = nil, simplexName: SimplexNameClaim? = nil, simplexNameWebPage: Bool = false, allowEmbedding: Bool = false) {
public init(groupWebPage: String? = nil, simplexName: SimplexNameClaim? = nil, domainWebPage: Bool = false, allowEmbedding: Bool = false) {
self.groupWebPage = groupWebPage
self.simplexName = simplexName
self.simplexNameWebPage = simplexNameWebPage
self.domainWebPage = domainWebPage
self.allowEmbedding = allowEmbedding
}
public var groupWebPage: String?
public var simplexName: SimplexNameClaim?
public var simplexNameWebPage: Bool = false
public var domainWebPage: Bool = false
public var allowEmbedding: Bool = false
}
@@ -2334,7 +2334,7 @@ data class SimplexNameClaim(
data class PublicGroupAccess(
val groupWebPage: String? = null,
val simplexName: SimplexNameClaim? = null,
val simplexNameWebPage: Boolean = false,
val domainWebPage: Boolean = false,
val allowEmbedding: Boolean = false
)
@@ -50,7 +50,7 @@ fun ChannelWebPageView(
val newAccess = PublicGroupAccess(
groupWebPage = trimmedPage.ifEmpty { null },
simplexName = access?.simplexName,
simplexNameWebPage = access?.simplexNameWebPage ?: false,
domainWebPage = access?.domainWebPage ?: false,
allowEmbedding = allowEmbedding.value
)
val gp = groupInfo.groupProfile.copy(
@@ -268,13 +268,16 @@ fun ModalData.NetworkAndServersView(closeNetworkAndServers: () -> Unit) {
if (currentRemoteHost == null && networkUseSocksProxy.value) {
SectionTextFooter(annotatedStringResource(MR.strings.socks_proxy_setting_limitations))
}
val saveDisabled = !serversCanBeSaved(currUserServers.value, userServers.value, serverErrors.value)
SectionItemView(
{ scope.launch { saveServers(rhId = currentRemoteHost?.remoteHostId, currUserServers, userServers) } },
disabled = saveDisabled,
) {
Text(stringResource(MR.strings.smp_servers_save), color = if (!saveDisabled) MaterialTheme.colors.onBackground else MaterialTheme.colors.secondary)
SectionDividerSpaced()
SectionView {
val saveDisabled = !serversCanBeSaved(currUserServers.value, userServers.value, serverErrors.value)
SectionItemView(
{ scope.launch { saveServers(rhId = currentRemoteHost?.remoteHostId, currUserServers, userServers) } },
disabled = saveDisabled,
) {
Text(stringResource(MR.strings.smp_servers_save), color = if (!saveDisabled) MaterialTheme.colors.onBackground else MaterialTheme.colors.secondary)
}
}
val serversErrs = globalServersErrors(serverErrors.value)
if (serversErrs.isNotEmpty()) {
+2 -2
View File
@@ -5662,9 +5662,9 @@ chatCommandP =
publicGroupAccessP = do
groupWebPage <- optional (" web=" *> (safeDecodeUtf8 <$> A.takeTill A.isSpace))
simplexName <- optional (" name=" *> strP)
simplexNameWebPage <- (" name_page=" *> onOffP) <|> pure False
domainWebPage <- (" name_page=" *> onOffP) <|> pure False
allowEmbedding <- (" embed=" *> onOffP) <|> pure False
pure PublicGroupAccess {groupWebPage, simplexName = mkSimplexNameClaim simplexName Nothing, simplexNameWebPage, allowEmbedding}
pure PublicGroupAccess {groupWebPage, simplexName = mkSimplexNameClaim simplexName Nothing, domainWebPage, allowEmbedding}
profileNameDescr = (,) <$> displayNameP <*> shortDescrP
-- 'Help with bot':'link <ID>','Menu of commands':[...]
botCommandsP :: Parser [ChatBotCommand]
+6 -6
View File
@@ -708,17 +708,17 @@ toPublicGroupProfile _ _ _ _ = Nothing
publicGroupAccessRow :: Maybe PublicGroupProfile -> PublicGroupAccessRow
publicGroupAccessRow pgp = case pgp >>= publicGroupAccess of
Just PublicGroupAccess {groupWebPage, simplexName, simplexNameWebPage, allowEmbedding} ->
(groupWebPage, claimName <$> simplexName, Just (BI simplexNameWebPage), Just (BI allowEmbedding), claimProof =<< simplexName)
Just PublicGroupAccess {groupWebPage, simplexName, domainWebPage, allowEmbedding} ->
(groupWebPage, claimName <$> simplexName, Just (BI domainWebPage), Just (BI allowEmbedding), claimProof =<< simplexName)
Nothing -> (Nothing, Nothing, Nothing, Nothing, Nothing)
toPublicGroupAccess :: PublicGroupAccessRow -> Maybe PublicGroupAccess
toPublicGroupAccess (groupWebPage, simplexName, simplexNameWebPage_, allowEmbedding_, simplexNameProof)
| isJust groupWebPage || isJust simplexName || simplexNameWebPage || allowEmbedding =
Just PublicGroupAccess {groupWebPage, simplexName = mkSimplexNameClaim simplexName simplexNameProof, simplexNameWebPage, allowEmbedding}
toPublicGroupAccess (groupWebPage, simplexName, domainWebPage_, allowEmbedding_, simplexNameProof)
| isJust groupWebPage || isJust simplexName || domainWebPage || allowEmbedding =
Just PublicGroupAccess {groupWebPage, simplexName = mkSimplexNameClaim simplexName simplexNameProof, domainWebPage, allowEmbedding}
| otherwise = Nothing
where
simplexNameWebPage = maybe False unBI simplexNameWebPage_
domainWebPage = maybe False unBI domainWebPage_
allowEmbedding = maybe False unBI allowEmbedding_
toGroupKeys :: Maybe B64UrlByteString -> GroupKeysRow -> Maybe GroupKeys
+1 -1
View File
@@ -846,7 +846,7 @@ instance ToField GroupType where toField = toField . textEncode
data PublicGroupAccess = PublicGroupAccess
{ groupWebPage :: Maybe Text,
simplexName :: Maybe SimplexNameClaim,
simplexNameWebPage :: Bool,
domainWebPage :: Bool,
allowEmbedding :: Bool
}
deriving (Eq, Show)