@@ -101,8 +101,10 @@ impl Timeline {
101
101
thumbnail : Option < Thumbnail > ,
102
102
) -> Result < Arc < SendAttachmentJoinHandle > , RoomError > {
103
103
let mime_str = mime_type. as_ref ( ) . ok_or ( RoomError :: InvalidAttachmentMimeType ) ?;
104
+
104
105
let mime_type =
105
106
mime_str. parse :: < Mime > ( ) . map_err ( |_| RoomError :: InvalidAttachmentMimeType ) ?;
107
+
106
108
let in_reply_to_event_id = params
107
109
. in_reply_to
108
110
. map ( EventId :: parse)
@@ -125,15 +127,11 @@ impl Timeline {
125
127
} ;
126
128
127
129
let handle = SendAttachmentJoinHandle :: new ( get_runtime_handle ( ) . spawn ( async move {
128
- let mut request =
129
- self . inner . send_attachment ( params. source , mime_type, attachment_config) ;
130
-
131
- if params. use_send_queue {
132
- request = request. use_send_queue ( ) ;
133
- }
134
-
135
- request. await . map_err ( |_| RoomError :: FailedSendingAttachment ) ?;
136
- Ok ( ( ) )
130
+ self . inner
131
+ . send_attachment ( params. source , mime_type, attachment_config)
132
+ . use_send_queue ( )
133
+ . await
134
+ . map_err ( |_| RoomError :: FailedSendingAttachment )
137
135
} ) ) ;
138
136
139
137
Ok ( handle)
@@ -197,10 +195,6 @@ pub struct UploadParameters {
197
195
mentions : Option < Mentions > ,
198
196
/// Optional Event ID to reply to.
199
197
in_reply_to : Option < String > ,
200
- /// Should the media be sent with the send queue, or synchronously?
201
- ///
202
- /// Watching progress only works with the synchronous method, at the moment.
203
- use_send_queue : bool ,
204
198
}
205
199
206
200
/// A source for uploading a file
0 commit comments