use for files

This commit is contained in:
Diogo
2024-11-20 14:51:54 +00:00
parent 400316bfdf
commit a04e8a3110
2 changed files with 38 additions and 0 deletions
@@ -207,6 +207,42 @@ fun OperatorViewLayout(
}
}
}
if (userServers.value[operatorIndex].xftpServers.any { !it.deleted }) {
SectionDividerSpaced()
SectionView(generalGetString(MR.strings.operator_use_for_sending).uppercase()) {
SectionItemView(padding = PaddingValues(horizontal = DEFAULT_PADDING)) {
Text(
stringResource(MR.strings.operator_use_for_files),
Modifier.padding(end = 24.dp),
color = Color.Unspecified
)
Spacer(Modifier.fillMaxWidth().weight(1f))
DefaultSwitch(
checked = userServers.value[operatorIndex].operator_.xftpRoles.storage,
onCheckedChange = { enabled ->
userServers.value = userServers.value.toMutableList().apply {
this[operatorIndex] = this[operatorIndex].copy(
operator = this[operatorIndex].operator?.copy(
xftpRoles = this[operatorIndex].operator?.xftpRoles?.copy(storage = enabled) ?: ServerRoles(storage = enabled, proxy = false)
)
)
}
scope.launch {
validateServers(rhId, userServers, serverErrors)
}
}
)
}
}
val xftpErrors = globalXFTPServersError(serverErrors.value)
if (xftpErrors != null) {
SectionCustomFooter {
ServerErrorsView(xftpErrors)
}
}
}
}
}
}
@@ -1704,6 +1704,8 @@
<string name="operator_use_for_messages_receiving">For receiving</string>
<string name="operator_use_for_messages_private_routing">For private routing</string>
<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>
<!-- AdvancedNetworkSettings.kt -->
<string name="network_option_tcp_connection">TCP connection</string>