@@ -229,16 +229,17 @@ final class TimelineProxy: TimelineProxyProtocol {
229
229
requestHandle: @MainActor ( SendAttachmentJoinHandleProtocol ) -> Void ) async -> Result < Void , TimelineProxyError > {
230
230
MXLog . info ( " Sending audio " )
231
231
232
- let handle = timeline. sendAudio ( url: url. path ( percentEncoded: false ) ,
233
- audioInfo: audioInfo,
234
- caption: caption,
235
- formattedCaption: nil , // Rust will build this from the caption's markdown.
236
- progressWatcher: nil ,
237
- useSendQueue: true )
238
-
239
- await requestHandle ( handle)
240
-
241
232
do {
233
+ let handle = try timeline. sendAudio ( params: . init( filename: url. path ( percentEncoded: false ) ,
234
+ caption: caption,
235
+ formattedCaption: nil , // Rust will build this from the caption's markdown.
236
+ mentions: nil ,
237
+ useSendQueue: true ) ,
238
+ audioInfo: audioInfo,
239
+ progressWatcher: nil )
240
+
241
+ await requestHandle ( handle)
242
+
242
243
try await handle. join ( )
243
244
MXLog . info ( " Finished sending audio " )
244
245
} catch {
@@ -255,16 +256,17 @@ final class TimelineProxy: TimelineProxyProtocol {
255
256
requestHandle: @MainActor ( SendAttachmentJoinHandleProtocol ) -> Void ) async -> Result < Void , TimelineProxyError > {
256
257
MXLog . info ( " Sending file " )
257
258
258
- let handle = timeline. sendFile ( url: url. path ( percentEncoded: false ) ,
259
- fileInfo: fileInfo,
260
- caption: caption,
261
- formattedCaption: nil , // Rust will build this from the caption's markdown.
262
- progressWatcher: nil ,
263
- useSendQueue: true )
264
-
265
- await requestHandle ( handle)
266
-
267
259
do {
260
+ let handle = try timeline. sendFile ( params: . init( filename: url. path ( percentEncoded: false ) ,
261
+ caption: caption,
262
+ formattedCaption: nil , // Rust will build this from the caption's markdown.
263
+ mentions: nil ,
264
+ useSendQueue: true ) ,
265
+ fileInfo: fileInfo,
266
+ progressWatcher: nil )
267
+
268
+ await requestHandle ( handle)
269
+
268
270
try await handle. join ( )
269
271
MXLog . info ( " Finished sending file " )
270
272
} catch {
@@ -282,17 +284,18 @@ final class TimelineProxy: TimelineProxyProtocol {
282
284
requestHandle: @MainActor ( SendAttachmentJoinHandleProtocol ) -> Void ) async -> Result < Void , TimelineProxyError > {
283
285
MXLog . info ( " Sending image " )
284
286
285
- let handle = timeline. sendImage ( url: url. path ( percentEncoded: false ) ,
286
- thumbnailUrl: thumbnailURL. path ( percentEncoded: false ) ,
287
- imageInfo: imageInfo,
288
- caption: caption,
289
- formattedCaption: nil , // Rust will build this from the caption's markdown.
290
- progressWatcher: nil ,
291
- useSendQueue: true )
292
-
293
- await requestHandle ( handle)
294
-
295
287
do {
288
+ let handle = try timeline. sendImage ( params: . init( filename: url. path ( percentEncoded: false ) ,
289
+ caption: caption,
290
+ formattedCaption: nil , // Rust will build this from the caption's markdown.
291
+ mentions: nil ,
292
+ useSendQueue: true ) ,
293
+ thumbnailPath: thumbnailURL. path ( percentEncoded: false ) ,
294
+ imageInfo: imageInfo,
295
+ progressWatcher: nil )
296
+
297
+ await requestHandle ( handle)
298
+
296
299
try await handle. join ( )
297
300
MXLog . info ( " Finished sending image " )
298
301
} catch {
@@ -328,17 +331,18 @@ final class TimelineProxy: TimelineProxyProtocol {
328
331
requestHandle: @MainActor ( SendAttachmentJoinHandleProtocol ) -> Void ) async -> Result < Void , TimelineProxyError > {
329
332
MXLog . info ( " Sending video " )
330
333
331
- let handle = timeline. sendVideo ( url: url. path ( percentEncoded: false ) ,
332
- thumbnailUrl: thumbnailURL. path ( percentEncoded: false ) ,
333
- videoInfo: videoInfo,
334
- caption: caption,
335
- formattedCaption: nil , // Rust will build this from the caption's markdown.
336
- progressWatcher: nil ,
337
- useSendQueue: true )
338
-
339
- await requestHandle ( handle)
340
-
341
334
do {
335
+ let handle = try timeline. sendVideo ( params: . init( filename: url. path ( percentEncoded: false ) ,
336
+ caption: caption,
337
+ formattedCaption: nil ,
338
+ mentions: nil ,
339
+ useSendQueue: true ) ,
340
+ thumbnailPath: thumbnailURL. path ( percentEncoded: false ) ,
341
+ videoInfo: videoInfo,
342
+ progressWatcher: nil )
343
+
344
+ await requestHandle ( handle)
345
+
342
346
try await handle. join ( )
343
347
MXLog . info ( " Finished sending video " )
344
348
} catch {
@@ -355,17 +359,18 @@ final class TimelineProxy: TimelineProxyProtocol {
355
359
requestHandle: @MainActor ( SendAttachmentJoinHandleProtocol ) -> Void ) async -> Result < Void , TimelineProxyError > {
356
360
MXLog . info ( " Sending voice message " )
357
361
358
- let handle = timeline. sendVoiceMessage ( url: url. path ( percentEncoded: false ) ,
359
- audioInfo: audioInfo,
360
- waveform: waveform,
361
- caption: nil ,
362
- formattedCaption: nil ,
363
- progressWatcher: nil ,
364
- useSendQueue: true )
365
-
366
- await requestHandle ( handle)
367
-
368
362
do {
363
+ let handle = try timeline. sendVoiceMessage ( params: . init( filename: url. path ( percentEncoded: false ) ,
364
+ caption: nil ,
365
+ formattedCaption: nil ,
366
+ mentions: nil ,
367
+ useSendQueue: true ) ,
368
+ audioInfo: audioInfo,
369
+ waveform: waveform,
370
+ progressWatcher: nil )
371
+
372
+ await requestHandle ( handle)
373
+
369
374
try await handle. join ( )
370
375
MXLog . info ( " Finished sending voice message " )
371
376
} catch {
0 commit comments