From 215d3e4d39630c61c63e25c0f5014cf34f905e19 Mon Sep 17 00:00:00 2001 From: Diogo Date: Wed, 20 Nov 2024 16:37:35 +0000 Subject: [PATCH] list xftp servers --- .../networkAndServers/OperatorView.kt | 34 +++++++++++++++++++ .../commonMain/resources/MR/base/strings.xml | 1 + 2 files changed, 35 insertions(+) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/OperatorView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/OperatorView.kt index 1964d8b856..5ec7a2d4b9 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/OperatorView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/OperatorView.kt @@ -243,6 +243,40 @@ fun OperatorViewLayout( } } + // Preset servers can't be deleted + if (userServers.value[operatorIndex].xftpServers.any { it.preset }) { + SectionDividerSpaced() + SectionView(generalGetString(MR.strings.media_and_file_servers).uppercase()) { + userServers.value[operatorIndex].xftpServers.forEach { server -> + SectionItemView { + ProtocolServerView( + srv = server, + serverProtocol = ServerProtocol.XFTP, + duplicateHosts = duplicateHosts + ) + } + } + } + val xftpErrors = globalXFTPServersError(serverErrors.value) + if (xftpErrors != null) { + SectionCustomFooter { + ServerErrorsView(xftpErrors) + } + } else { + SectionTextFooter( + remember(currentUser?.displayName) { + buildAnnotatedString { + append(generalGetString(MR.strings.xftp_servers_per_user) + " ") + withStyle(SpanStyle(fontWeight = FontWeight.Bold)) { + append(currentUser?.displayName ?: "") + } + append(".") + } + } + ) + } + } + } } } diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml index 43325e69e3..0476e3793b 100644 --- a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml +++ b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml @@ -1706,6 +1706,7 @@ Added message servers Use for files For sending + The servers for new files of your current chat profile TCP connection