@@ -455,7 +455,7 @@ impl RoomSendQueue {
455
455
let send_handle = SendHandle {
456
456
room : self . clone ( ) ,
457
457
transaction_id : transaction_id. clone ( ) ,
458
- media_handles : None ,
458
+ media_handles : vec ! [ ] ,
459
459
created_at,
460
460
} ;
461
461
@@ -1338,7 +1338,7 @@ impl QueueStorage {
1338
1338
send_handle : SendHandle {
1339
1339
room : room. clone ( ) ,
1340
1340
transaction_id : queued. transaction_id ,
1341
- media_handles : None ,
1341
+ media_handles : vec ! [ ] ,
1342
1342
created_at : queued. created_at ,
1343
1343
} ,
1344
1344
send_error : queued. error ,
@@ -1395,10 +1395,10 @@ impl QueueStorage {
1395
1395
send_handle : SendHandle {
1396
1396
room : room. clone ( ) ,
1397
1397
transaction_id : dep. own_transaction_id . into ( ) ,
1398
- media_handles : Some ( MediaHandles {
1398
+ media_handles : vec ! [ MediaHandles {
1399
1399
upload_thumbnail_txn: thumbnail_info. map( |info| info. txn) ,
1400
1400
upload_file_txn: file_upload,
1401
- } ) ,
1401
+ } ] ,
1402
1402
created_at : dep. created_at ,
1403
1403
} ,
1404
1404
send_error : None ,
@@ -1911,15 +1911,15 @@ pub struct SendHandle {
1911
1911
transaction_id : OwnedTransactionId ,
1912
1912
1913
1913
/// Additional handles for a media upload.
1914
- media_handles : Option < MediaHandles > ,
1914
+ media_handles : Vec < MediaHandles > ,
1915
1915
1916
1916
/// The time at which the event to be sent has been created.
1917
1917
pub created_at : MilliSecondsSinceUnixEpoch ,
1918
1918
}
1919
1919
1920
1920
impl SendHandle {
1921
1921
fn nyi_for_uploads ( & self ) -> Result < ( ) , RoomSendQueueStorageError > {
1922
- if self . media_handles . is_some ( ) {
1922
+ if ! self . media_handles . is_empty ( ) {
1923
1923
Err ( RoomSendQueueStorageError :: OperationNotImplementedYet )
1924
1924
} else {
1925
1925
Ok ( ( ) )
@@ -1936,7 +1936,7 @@ impl SendHandle {
1936
1936
1937
1937
let queue = & self . room . inner . queue ;
1938
1938
1939
- if let Some ( handles) = & self . media_handles {
1939
+ for handles in & self . media_handles {
1940
1940
if queue. abort_upload ( & self . transaction_id , handles) . await ? {
1941
1941
// Propagate a cancelled update.
1942
1942
let _ = self . room . inner . updates . send ( RoomSendQueueUpdate :: CancelledLocalEvent {
@@ -2069,7 +2069,7 @@ impl SendHandle {
2069
2069
// one entry will be updated in the store. The other two are either
2070
2070
// done, or dependent requests.
2071
2071
2072
- if let Some ( handles) = & self . media_handles {
2072
+ for handles in & self . media_handles {
2073
2073
room. queue
2074
2074
. mark_as_unwedged ( & handles. upload_file_txn )
2075
2075
. await
@@ -2166,7 +2166,7 @@ impl SendReactionHandle {
2166
2166
let handle = SendHandle {
2167
2167
room : self . room . clone ( ) ,
2168
2168
transaction_id : self . transaction_id . clone ( ) . into ( ) ,
2169
- media_handles : None ,
2169
+ media_handles : vec ! [ ] ,
2170
2170
created_at : MilliSecondsSinceUnixEpoch :: now ( ) ,
2171
2171
} ;
2172
2172
0 commit comments