feat(jsonrpc): add copy_to_blobdir api (#6660)

Add a new API to jsonrpc to copy a file over to blobdir. This enables
desktop tauri to not give global file permission.
This commit is contained in:
Sebastian Klähn
2025-03-17 14:08:44 +01:00
committed by GitHub
parent 156f9642fe
commit 3d061d1dbd
3 changed files with 13 additions and 2 deletions

View File

@@ -193,6 +193,7 @@ impl<'a> BlobObject<'a> {
/// Note that this is NOT the user-visible filename,
/// which is only stored in Param::Filename on the message.
///
#[allow(rustdoc::private_intra_doc_links)]
/// [Params]: crate::param::Params
pub fn as_name(&self) -> &str {
&self.name
@@ -251,6 +252,7 @@ impl<'a> BlobObject<'a> {
Ok(blob.as_name().to_string())
}
/// Recode image to avatar size.
pub async fn recode_to_avatar_size(&mut self, context: &Context) -> Result<()> {
let (img_wh, max_bytes) =
match MediaQuality::from_i32(context.get_config_int(Config::MediaQuality).await?)