list xftp servers

This commit is contained in:
Diogo
2024-11-20 16:37:35 +00:00
parent de4055af7f
commit 215d3e4d39
2 changed files with 35 additions and 0 deletions
@@ -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(".")
}
}
)
}
}
}
}
}
@@ -1706,6 +1706,7 @@
<string name="operator_added_message_servers">Added message servers</string>
<string name="operator_use_for_files">Use for files</string>
<string name="operator_use_for_sending">For sending</string>
<string name="xftp_servers_per_user">The servers for new files of your current chat profile</string>
<!-- AdvancedNetworkSettings.kt -->
<string name="network_option_tcp_connection">TCP connection</string>