mirror of
https://github.com/ArcaneChat/core.git
synced 2026-07-03 14:05:33 +02:00
add orientation field to manifest.toml
This commit is contained in:
@@ -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),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user