File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
crates/matrix-sdk/src/latest_events Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,9 @@ impl LatestEvent {
67
67
self . value . subscribe ( ) . await
68
68
}
69
69
70
- /// Update the inner latest event value.
71
- pub async fn update (
70
+ /// Update the inner latest event value, based on the event cache
71
+ /// (specifically with a [`RoomEventCache`]).
72
+ pub async fn update_with_event_cache (
72
73
& mut self ,
73
74
room_event_cache : & RoomEventCache ,
74
75
power_levels : & Option < ( & UserId , RoomPowerLevels ) > ,
Original file line number Diff line number Diff line change @@ -507,8 +507,9 @@ impl RoomLatestEvents {
507
507
self . per_thread . get ( thread_id)
508
508
}
509
509
510
- /// Update the latest events for the room and its threads.
511
- async fn update ( & mut self ) {
510
+ /// Update the latest events for the room and its threads, based on the
511
+ /// event cache data.
512
+ async fn update_with_event_cache ( & mut self ) {
512
513
// Get the power levels of the user for the current room if the `WeakRoom` is
513
514
// still valid.
514
515
//
@@ -525,10 +526,10 @@ impl RoomLatestEvents {
525
526
None => None ,
526
527
} ;
527
528
528
- self . for_the_room . update ( & self . room_event_cache , & power_levels) . await ;
529
+ self . for_the_room . update_with_event_cache ( & self . room_event_cache , & power_levels) . await ;
529
530
530
531
for latest_event in self . per_thread . values_mut ( ) {
531
- latest_event. update ( & self . room_event_cache , & power_levels) . await ;
532
+ latest_event. update_with_event_cache ( & self . room_event_cache , & power_levels) . await ;
532
533
}
533
534
}
534
535
}
@@ -677,7 +678,7 @@ async fn compute_latest_events(
677
678
let mut rooms = registered_rooms. rooms . write ( ) . await ;
678
679
679
680
if let Some ( room_latest_events) = rooms. get_mut ( room_id) {
680
- room_latest_events. update ( ) . await ;
681
+ room_latest_events. update_with_event_cache ( ) . await ;
681
682
} else {
682
683
error ! ( ?room_id, "Failed to find the room" ) ;
683
684
You can’t perform that action at this time.
0 commit comments