add orientation field to manifest.toml

This commit is contained in:
adbenitez
2023-09-11 01:20:35 +02:00
parent 34955ecce4
commit 5a99f550fe
2 changed files with 16 additions and 0 deletions
@@ -35,6 +35,9 @@ pub struct WebxdcMessageInfo {
source_code_url: Option<String>,
/// True if full internet access should be granted to the app.
internet_access: bool,
/// prefered screen orientation (landscape or portrait).
orientation: Option<String>,
}
impl WebxdcMessageInfo {
@@ -50,6 +53,7 @@ impl WebxdcMessageInfo {
summary,
source_code_url,
internet_access,
orientation,
} = message.get_webxdc_info(context).await?;
Ok(Self {
@@ -59,6 +63,7 @@ impl WebxdcMessageInfo {
summary: maybe_empty_string_to_option(summary),
source_code_url: maybe_empty_string_to_option(source_code_url),
internet_access,
orientation: maybe_empty_string_to_option(orientation),
})
}
}
+11
View File
@@ -83,6 +83,9 @@ pub struct WebxdcManifest {
/// If the webxdc requests network access.
pub request_internet_access: Option<bool>,
/// prefered screen orientation (landscape or portrait).
pub orientation: Option<String>,
}
/// Parsed information from WebxdcManifest and fallbacks.
@@ -111,6 +114,9 @@ pub struct WebxdcInfo {
/// It should request access, be encrypted
/// and sent to self for this.
pub internet_access: bool,
/// prefered screen orientation (landscape or portrait).
pub orientation: String,
}
/// Status Update ID.
@@ -841,6 +847,11 @@ impl Message {
"".to_string()
},
internet_access,
orientation: if let Some(orientation) = manifest.orientation {
orientation
} else {
"".to_string()
},
})
}
}