@@ -463,10 +463,8 @@ pub struct RoomInfo {
463463 pub ( crate ) encryption_state_synced : bool ,
464464
465465 /// The latest event value of this room.
466- ///
467- /// TODO(@hywan): Rename to `latest_event`.
468466 #[ serde( default ) ]
469- pub ( crate ) new_latest_event : LatestEventValue ,
467+ pub ( crate ) latest_event_value : LatestEventValue ,
470468
471469 /// Information about read receipts for this room.
472470 #[ serde( default ) ]
@@ -534,7 +532,7 @@ impl RoomInfo {
534532 last_prev_batch : None ,
535533 sync_info : SyncInfo :: NoState ,
536534 encryption_state_synced : false ,
537- new_latest_event : LatestEventValue :: default ( ) ,
535+ latest_event_value : LatestEventValue :: default ( ) ,
538536 read_receipts : Default :: default ( ) ,
539537 base_info : Box :: new ( BaseRoomInfo :: new ( ) ) ,
540538 warned_about_unknown_room_version_rules : Arc :: new ( false . into ( ) ) ,
@@ -1034,8 +1032,8 @@ impl RoomInfo {
10341032 }
10351033
10361034 /// Sets the new [`LatestEventValue`].
1037- pub fn set_new_latest_event ( & mut self , new_value : LatestEventValue ) {
1038- self . new_latest_event = new_value;
1035+ pub fn set_latest_event ( & mut self , new_value : LatestEventValue ) {
1036+ self . latest_event_value = new_value;
10391037 }
10401038
10411039 /// Updates the recency stamp of this room.
@@ -1308,7 +1306,7 @@ mod tests {
13081306 last_prev_batch : Some ( "pb" . to_owned ( ) ) ,
13091307 sync_info : SyncInfo :: FullySynced ,
13101308 encryption_state_synced : true ,
1311- new_latest_event : LatestEventValue :: None ,
1309+ latest_event_value : LatestEventValue :: None ,
13121310 base_info : Box :: new (
13131311 assign ! ( BaseRoomInfo :: new( ) , { pinned_events: Some ( RoomPinnedEventsEventContent :: new( vec![ owned_event_id!( "$a" ) ] ) ) } ) ,
13141312 ) ,
@@ -1341,14 +1339,7 @@ mod tests {
13411339 "last_prev_batch" : "pb" ,
13421340 "sync_info" : "FullySynced" ,
13431341 "encryption_state_synced" : true ,
1344- "latest_event" : {
1345- "event" : {
1346- "kind" : { "PlainText" : { "event" : { "sender" : "@u:i.uk" } } } ,
1347- "thread_summary" : "None" ,
1348- "timestamp" : null,
1349- } ,
1350- } ,
1351- "new_latest_event" : "None" ,
1342+ "latest_event_value" : "None" ,
13521343 "base_info" : {
13531344 "avatar" : null,
13541345 "canonical_alias" : null,
@@ -1543,7 +1534,7 @@ mod tests {
15431534 assert_eq ! ( info. last_prev_batch, Some ( "pb" . to_owned( ) ) ) ;
15441535 assert_eq ! ( info. sync_info, SyncInfo :: FullySynced ) ;
15451536 assert ! ( info. encryption_state_synced) ;
1546- assert_matches ! ( info. new_latest_event , LatestEventValue :: None ) ;
1537+ assert_matches ! ( info. latest_event_value , LatestEventValue :: None ) ;
15471538 assert ! ( info. base_info. avatar. is_none( ) ) ;
15481539 assert ! ( info. base_info. canonical_alias. is_none( ) ) ;
15491540 assert ! ( info. base_info. create. is_none( ) ) ;
0 commit comments