File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
bindings/matrix-sdk-ffi/src Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1026,10 +1026,11 @@ impl Client {
1026
1026
& self ,
1027
1027
mime_type : String ,
1028
1028
data : Vec < u8 > ,
1029
+ filename : Option < String > ,
1029
1030
progress_watcher : Option < Box < dyn ProgressWatcher > > ,
1030
1031
) -> Result < String , ClientError > {
1031
1032
let mime_type: mime:: Mime = mime_type. parse ( ) . context ( "Parsing mime type" ) ?;
1032
- let request = self . inner . media ( ) . upload ( & mime_type, data, None ) ;
1033
+ let request = self . inner . media ( ) . upload ( & mime_type, data, filename , None ) ;
1033
1034
1034
1035
if let Some ( progress_watcher) = progress_watcher {
1035
1036
let mut subscriber = request. subscribe_to_send_progress ( ) ;
Original file line number Diff line number Diff line change @@ -219,7 +219,11 @@ pub enum UploadSource {
219
219
/// Upload source is a file on disk
220
220
File {
221
221
/// Path to file
222
- filename : String ,
222
+ path : String ,
223
+
224
+ /// An optional filename, if the one in the path is not the one we want
225
+ /// to use for the file.
226
+ filename : Option < String > ,
223
227
} ,
224
228
/// Upload source is data in memory
225
229
Data {
@@ -233,7 +237,7 @@ pub enum UploadSource {
233
237
impl From < UploadSource > for AttachmentSource {
234
238
fn from ( value : UploadSource ) -> Self {
235
239
match value {
236
- UploadSource :: File { filename } => Self :: File ( filename . into ( ) ) ,
240
+ UploadSource :: File { path , filename } => Self :: File { path : path . into ( ) , filename } ,
237
241
UploadSource :: Data { bytes, filename } => Self :: Data { bytes, filename } ,
238
242
}
239
243
}
You can’t perform that action at this time.
0 commit comments