mirror of
https://github.com/chatmail/core.git
synced 2026-04-24 17:06:28 +03:00
feat: show if proxy is enabled in connectivity view (#7359)
closes #7269
This commit is contained in:
@@ -7736,6 +7736,16 @@ void dc_event_unref(dc_event_t* event);
|
|||||||
/// `%1$s` will be replaced with the channel name.
|
/// `%1$s` will be replaced with the channel name.
|
||||||
#define DC_STR_SECURE_JOIN_CHANNEL_QR_DESC 201
|
#define DC_STR_SECURE_JOIN_CHANNEL_QR_DESC 201
|
||||||
|
|
||||||
|
/// "Proxy Enabled"
|
||||||
|
///
|
||||||
|
/// Title for proxy section in connectivity view.
|
||||||
|
#define DC_STR_PROXY_ENABLED 220
|
||||||
|
|
||||||
|
/// "You are using a proxy. If you're having trouble connecting, try a different proxy."
|
||||||
|
///
|
||||||
|
/// Description in connectivity view when proxy is enabled.
|
||||||
|
#define DC_STR_PROXY_ENABLED_DESCRIPTION 221
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -351,6 +351,19 @@ impl Context {
|
|||||||
<body>"#
|
<body>"#
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
|
// =============================================================================================
|
||||||
|
// Get proxy state
|
||||||
|
// =============================================================================================
|
||||||
|
|
||||||
|
if self
|
||||||
|
.get_config_bool(crate::config::Config::ProxyEnabled)
|
||||||
|
.await?
|
||||||
|
{
|
||||||
|
let proxy_enabled = stock_str::proxy_enabled(self).await;
|
||||||
|
let proxy_description = stock_str::proxy_description(self).await;
|
||||||
|
ret += &format!("<h3>{proxy_enabled}</h3><ul><li>{proxy_description}</li></ul>");
|
||||||
|
}
|
||||||
|
|
||||||
// =============================================================================================
|
// =============================================================================================
|
||||||
// Get the states from the RwLock
|
// Get the states from the RwLock
|
||||||
// =============================================================================================
|
// =============================================================================================
|
||||||
|
|||||||
@@ -436,6 +436,14 @@ https://delta.chat/donate"))]
|
|||||||
fallback = "The attachment contains anonymous usage statistics, which helps us improve Delta Chat. Thank you!"
|
fallback = "The attachment contains anonymous usage statistics, which helps us improve Delta Chat. Thank you!"
|
||||||
))]
|
))]
|
||||||
StatsMsgBody = 210,
|
StatsMsgBody = 210,
|
||||||
|
|
||||||
|
#[strum(props(fallback = "Proxy Enabled"))]
|
||||||
|
ProxyEnabled = 220,
|
||||||
|
|
||||||
|
#[strum(props(
|
||||||
|
fallback = "You are using a proxy. If you're having trouble connecting, try a different proxy."
|
||||||
|
))]
|
||||||
|
ProxyEnabledDescription = 221,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StockMessage {
|
impl StockMessage {
|
||||||
@@ -1309,6 +1317,16 @@ pub(crate) async fn backup_transfer_msg_body(context: &Context) -> String {
|
|||||||
translated(context, StockMessage::BackupTransferMsgBody).await
|
translated(context, StockMessage::BackupTransferMsgBody).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Stock string: `Proxy Enabled`.
|
||||||
|
pub(crate) async fn proxy_enabled(context: &Context) -> String {
|
||||||
|
translated(context, StockMessage::ProxyEnabled).await
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Stock string: `You are using a proxy. If you're having trouble connecting, try a different proxy.`.
|
||||||
|
pub(crate) async fn proxy_description(context: &Context) -> String {
|
||||||
|
translated(context, StockMessage::ProxyEnabledDescription).await
|
||||||
|
}
|
||||||
|
|
||||||
impl Context {
|
impl Context {
|
||||||
/// Set the stock string for the [StockMessage].
|
/// Set the stock string for the [StockMessage].
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user