From 02fdf8c0d36af6fd2cbedfc202599b77da2dc4d2 Mon Sep 17 00:00:00 2001 From: Michael Goldenberg Date: Fri, 25 Apr 2025 17:30:30 -0400 Subject: [PATCH] feat(ffi): add UploadSource for representing upload data Signed-off-by: Michael Goldenberg --- bindings/matrix-sdk-ffi/src/timeline/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bindings/matrix-sdk-ffi/src/timeline/mod.rs b/bindings/matrix-sdk-ffi/src/timeline/mod.rs index 59d147427..3560f6820 100644 --- a/bindings/matrix-sdk-ffi/src/timeline/mod.rs +++ b/bindings/matrix-sdk-ffi/src/timeline/mod.rs @@ -223,6 +223,23 @@ pub struct UploadParameters { use_send_queue: bool, } +/// A source for uploading a file +#[derive(uniffi::Enum)] +pub enum UploadSource { + /// Upload source is a file on disk + File { + /// Path to file + filename: String, + }, + /// Upload source is data in memory + Data { + /// Data being uploaded + data: Vec, + /// Filename to associate with data + filename: String, + }, +} + #[derive(uniffi::Record)] pub struct ReplyParameters { /// The ID of the event to reply to.