From 1d4adf61dd5050463a6eb696dc45037f7cdb6231 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 7 Jun 2024 20:03:50 +0200 Subject: [PATCH] rename manifest entry to request_integration --- deltachat-jsonrpc/src/api/types/webxdc.rs | 2 +- src/webxdc.rs | 14 +++++++------- src/webxdc/integration.rs | 4 ++-- test-data/webxdc/mapstest-integration-set.xdc | Bin 411 -> 409 bytes 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deltachat-jsonrpc/src/api/types/webxdc.rs b/deltachat-jsonrpc/src/api/types/webxdc.rs index 195d501011..37145f2888 100644 --- a/deltachat-jsonrpc/src/api/types/webxdc.rs +++ b/deltachat-jsonrpc/src/api/types/webxdc.rs @@ -49,7 +49,7 @@ impl WebxdcMessageInfo { document, summary, source_code_url, - integration: _, + request_integration: _, internet_access, } = message.get_webxdc_info(context).await?; diff --git a/src/webxdc.rs b/src/webxdc.rs index d0707bde2c..94345a939f 100644 --- a/src/webxdc.rs +++ b/src/webxdc.rs @@ -66,8 +66,8 @@ pub struct WebxdcManifest { /// Optional URL of webxdc source code. pub source_code_url: Option, - /// Set to "maps" if the webxdc is an integration. - pub integration: Option, + /// Set to "map" to request integration. + pub request_integration: Option, /// If the webxdc requests network access. pub request_internet_access: Option, @@ -95,8 +95,8 @@ pub struct WebxdcInfo { /// URL of webxdc source code or an empty string. pub source_code_url: String, - /// Set to "maps" if the webxdc is an integration, otherwise an empty string. - pub integration: String, + /// Set to "map" to request integration, otherwise an empty string. + pub request_integration: String, /// If the webxdc is allowed to access the network. /// It should request access, be encrypted @@ -824,7 +824,7 @@ impl Message { } } - let request_integration = manifest.integration.unwrap_or_default(); + let request_integration = manifest.request_integration.unwrap_or_default(); let is_integrated = self.is_set_as_webxdc_integration(context).await?; let internet_access = manifest.request_internet_access.unwrap_or_default() @@ -851,7 +851,7 @@ impl Message { .to_string(), summary: if is_integrated { "🌍 Used as map. Delete to use default. Do not enter sensitive data".to_string() - } else if request_integration == "maps" { + } else if request_integration == "map" { "🌏 To use as map, forward to \"Saved Messages\" again. Do not enter sensitive data" .to_string() } else if internet_access { @@ -867,7 +867,7 @@ impl Message { } else { "".to_string() }, - integration: request_integration, + request_integration, internet_access, }) } diff --git a/src/webxdc/integration.rs b/src/webxdc/integration.rs index d320e98ffb..b07600def6 100644 --- a/src/webxdc/integration.rs +++ b/src/webxdc/integration.rs @@ -67,7 +67,7 @@ impl Context { true } else if msg.chat_id.is_self_talk(context).await? { let info = msg.get_webxdc_info(context).await?; - if info.integration == "maps" { + if info.request_integration == "map" { msg.param.set_int(Param::WebxdcIntegration, 1); msg.update_param(context).await?; true @@ -195,7 +195,7 @@ mod tests { t.send_msg(self_chat.id, &mut msg).await; assert_integration(&t, "with some icon").await?; // still the default integration - // send a maps.xdc with manifest including the line `integration = "maps"` + // send a maps.xdc with manifest including the line `request_integration = "map"` let mut msg = Message::new(Viewtype::Webxdc); msg.set_file_from_bytes( &t, diff --git a/test-data/webxdc/mapstest-integration-set.xdc b/test-data/webxdc/mapstest-integration-set.xdc index 76ea721b948aeee0799564ae5bf5cae4ecaebf81..e25819ce95d78da3c5922fcd24dd5a3dabd91249 100644 GIT binary patch delta 121 zcmbQuJd=5XA#5dOR_h3C8sq4<@!~%wY+q7SdAVV zfA$Kx+%4p7^!c+xR*^7wz|*czLEevqCr=LU?r!{~>bi7g%*2PWs76ipW>jYenl-tU MQGx9N&~OF@0P-v;3;+NC delta 150 zcmbQqJezrfA#=y{#EB+)yagG@BF>gtd~;@CVDOxnFUj6AJu$5nDA%v5d+Lm~r?0-3 z&dD?9nNL1tdOBrCR}i;%;WCr_?CN?On~Y0;$+y@~f@Q4O2y$*8Ug kGOe_Nn}Lz#D