diff --git a/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift b/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift index 5c85da9e47..247144da04 100644 --- a/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift +++ b/apps/ios/Shared/Views/Chat/Group/ChannelWebAccessView.swift @@ -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 diff --git a/apps/ios/SimpleXChat/ChatTypes.swift b/apps/ios/SimpleXChat/ChatTypes.swift index cd1724fe70..7bdb664fad 100644 --- a/apps/ios/SimpleXChat/ChatTypes.swift +++ b/apps/ios/SimpleXChat/ChatTypes.swift @@ -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 } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt index def5769b8d..4e83a614b2 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt @@ -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 ) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/ChannelWebPageView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/ChannelWebPageView.kt index edda49e493..30595b8c5c 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/ChannelWebPageView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/ChannelWebPageView.kt @@ -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( diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NetworkAndServers.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NetworkAndServers.kt index 73204b42ff..556c7270cc 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NetworkAndServers.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NetworkAndServers.kt @@ -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()) { diff --git a/src/Simplex/Chat/Library/Commands.hs b/src/Simplex/Chat/Library/Commands.hs index c7ead2ec2c..b13fe20196 100644 --- a/src/Simplex/Chat/Library/Commands.hs +++ b/src/Simplex/Chat/Library/Commands.hs @@ -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 ','Menu of commands':[...] botCommandsP :: Parser [ChatBotCommand] diff --git a/src/Simplex/Chat/Store/Shared.hs b/src/Simplex/Chat/Store/Shared.hs index 215d0c1052..5b34273733 100644 --- a/src/Simplex/Chat/Store/Shared.hs +++ b/src/Simplex/Chat/Store/Shared.hs @@ -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 diff --git a/src/Simplex/Chat/Types.hs b/src/Simplex/Chat/Types.hs index 30ba7066bc..2509b5f551 100644 --- a/src/Simplex/Chat/Types.hs +++ b/src/Simplex/Chat/Types.hs @@ -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)