@@ -37,8 +37,12 @@ use ruma::{
37
37
events:: {
38
38
presence:: PresenceEvent ,
39
39
receipt:: { Receipt , ReceiptThread , ReceiptType } ,
40
- room:: member:: {
41
- MembershipState , RoomMemberEventContent , StrippedRoomMemberEvent , SyncRoomMemberEvent ,
40
+ room:: {
41
+ create,
42
+ member:: {
43
+ MembershipState , RoomMemberEventContent , StrippedRoomMemberEvent ,
44
+ SyncRoomMemberEvent ,
45
+ } ,
42
46
} ,
43
47
AnyGlobalAccountDataEvent , AnyRoomAccountDataEvent , AnySyncStateEvent ,
44
48
GlobalAccountDataEventType , RoomAccountDataEventType , StateEventType , SyncStateEvent ,
@@ -442,7 +446,7 @@ struct PersistedQueuedRequest {
442
446
/// The time the original message was first attempted to be sent at.
443
447
#[ serde( skip_serializing_if = "Option::is_none" ) ]
444
448
created_at : Option < MilliSecondsSinceUnixEpoch > ,
445
-
449
+
446
450
// Migrated fields: keep these private, they're not used anymore elsewhere in the code base.
447
451
/// Deprecated (from old format), now replaced with error field.
448
452
is_wedged : Option < bool > ,
@@ -1370,7 +1374,7 @@ impl_state_store!({
1370
1374
transaction_id: OwnedTransactionId ,
1371
1375
kind: QueuedRequestKind ,
1372
1376
priority: usize ,
1373
- ) -> Result <( ) > {
1377
+ ) -> Result <MilliSecondsSinceUnixEpoch > {
1374
1378
let encoded_key = self . encode_key( keys:: ROOM_SEND_QUEUE , room_id) ;
1375
1379
1376
1380
let tx = self
@@ -1389,7 +1393,7 @@ impl_state_store!({
1389
1393
|| Ok ( Vec :: new( ) ) ,
1390
1394
|val| self . deserialize_value:: <Vec <PersistedQueuedRequest >>( & val) ,
1391
1395
) ?;
1392
-
1396
+ let created_at = MilliSecondsSinceUnixEpoch :: now ( ) ;
1393
1397
// Push the new request.
1394
1398
prev. push( PersistedQueuedRequest {
1395
1399
room_id: room_id. to_owned( ) ,
@@ -1399,15 +1403,15 @@ impl_state_store!({
1399
1403
is_wedged: None ,
1400
1404
event: None ,
1401
1405
priority: Some ( priority) ,
1402
- created_at: Some ( MilliSecondsSinceUnixEpoch :: now ( ) ) ,
1406
+ created_at: Some ( created_at . clone ( ) ) ,
1403
1407
} ) ;
1404
1408
1405
1409
// Save the new vector into db.
1406
1410
obj. put_key_val( & encoded_key, & self . serialize_value( & prev) ?) ?;
1407
1411
1408
1412
tx. await . into_result( ) ?;
1409
1413
1410
- Ok ( ( ) )
1414
+ Ok ( created_at )
1411
1415
}
1412
1416
1413
1417
async fn update_send_queue_request(
@@ -1570,7 +1574,7 @@ impl_state_store!({
1570
1574
parent_txn_id: & TransactionId ,
1571
1575
own_txn_id: ChildTransactionId ,
1572
1576
content: DependentQueuedRequestKind ,
1573
- ) -> Result <( ) > {
1577
+ ) -> Result <MilliSecondsSinceUnixEpoch > {
1574
1578
let encoded_key = self . encode_key( keys:: DEPENDENT_SEND_QUEUE , room_id) ;
1575
1579
1576
1580
let tx = self . inner. transaction_on_one_with_mode(
@@ -1589,21 +1593,22 @@ impl_state_store!({
1589
1593
|val| self . deserialize_value:: <Vec <DependentQueuedRequest >>( & val) ,
1590
1594
) ?;
1591
1595
1596
+ let created_at = MilliSecondsSinceUnixEpoch :: now( ) ;
1592
1597
// Push the new request.
1593
1598
prev. push( DependentQueuedRequest {
1594
1599
kind: content,
1595
1600
parent_transaction_id: parent_txn_id. to_owned( ) ,
1596
1601
own_transaction_id: own_txn_id,
1597
1602
parent_key: None ,
1598
- created_at: None ,
1603
+ created_at: Some ( created_at . clone ( ) ) ,
1599
1604
} ) ;
1600
1605
1601
1606
// Save the new vector into db.
1602
1607
obj. put_key_val( & encoded_key, & self . serialize_value( & prev) ?) ?;
1603
1608
1604
1609
tx. await . into_result( ) ?;
1605
1610
1606
- Ok ( ( ) )
1611
+ Ok ( created_at )
1607
1612
}
1608
1613
1609
1614
async fn update_dependent_queued_request(
0 commit comments