File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -7736,6 +7736,16 @@ void dc_event_unref(dc_event_t* event);
77367736/// `%1$s` will be replaced with the channel name.
77377737#define DC_STR_SECURE_JOIN_CHANNEL_QR_DESC 201
77387738
7739+ /// "Proxy Enabled"
7740+ ///
7741+ /// Title for proxy section in connectivity view.
7742+ #define DC_STR_PROXY_ENABLED 220
7743+
7744+ /// "You are using a proxy. If you're having trouble connecting, try a different proxy."
7745+ ///
7746+ /// Description in connectivity view when proxy is enabled.
7747+ #define DC_STR_PROXY_ENABLED_DESCRIPTION 221
7748+
77397749/**
77407750 * @}
77417751 */
Original file line number Diff line number Diff line change @@ -351,6 +351,19 @@ impl Context {
351351 <body>"#
352352 . to_string ( ) ;
353353
354+ // =============================================================================================
355+ // Get proxy state
356+ // =============================================================================================
357+
358+ if self
359+ . get_config_bool ( crate :: config:: Config :: ProxyEnabled )
360+ . await ?
361+ {
362+ let proxy_enabled = stock_str:: proxy_enabled ( self ) . await ;
363+ let proxy_description = stock_str:: proxy_description ( self ) . await ;
364+ ret += & format ! ( "<h3>{proxy_enabled}</h3><ul><li>{proxy_description}</li></ul>" ) ;
365+ }
366+
354367 // =============================================================================================
355368 // Get the states from the RwLock
356369 // =============================================================================================
Original file line number Diff line number Diff line change @@ -436,6 +436,14 @@ https://delta.chat/donate"))]
436436 fallback = "The attachment contains anonymous usage statistics, which helps us improve Delta Chat. Thank you!"
437437 ) ) ]
438438 StatsMsgBody = 210 ,
439+
440+ #[ strum( props( fallback = "Proxy Enabled" ) ) ]
441+ ProxyEnabled = 220 ,
442+
443+ #[ strum( props(
444+ fallback = "You are using a proxy. If you're having trouble connecting, try a different proxy."
445+ ) ) ]
446+ ProxyEnabledDescription = 221 ,
439447}
440448
441449impl StockMessage {
@@ -1309,6 +1317,16 @@ pub(crate) async fn backup_transfer_msg_body(context: &Context) -> String {
13091317 translated ( context, StockMessage :: BackupTransferMsgBody ) . await
13101318}
13111319
1320+ /// Stock string: `Proxy Enabled`.
1321+ pub ( crate ) async fn proxy_enabled ( context : & Context ) -> String {
1322+ translated ( context, StockMessage :: ProxyEnabled ) . await
1323+ }
1324+
1325+ /// Stock string: `You are using a proxy. If you're having trouble connecting, try a different proxy.`.
1326+ pub ( crate ) async fn proxy_description ( context : & Context ) -> String {
1327+ translated ( context, StockMessage :: ProxyEnabledDescription ) . await
1328+ }
1329+
13121330impl Context {
13131331 /// Set the stock string for the [StockMessage].
13141332 ///
You can’t perform that action at this time.
0 commit comments