File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
crates/matrix-sdk/src/sliding_sync Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,11 @@ impl SlidingSyncRoom {
108
108
& self . inner . required_state
109
109
}
110
110
111
+ /// Get the previous batch.
112
+ fn prev_batch ( & self ) -> Option < & String > {
113
+ self . inner . prev_batch . as_ref ( )
114
+ }
115
+
111
116
/// `Timeline` of this room
112
117
pub async fn timeline ( & self ) -> Option < Timeline > {
113
118
Some ( self . timeline_builder ( ) ?. track_read_marker_and_receipts ( ) . build ( ) . await )
@@ -126,7 +131,7 @@ impl SlidingSyncRoom {
126
131
if let Some ( room) = self . client . get_room ( & self . room_id ) {
127
132
Some (
128
133
Timeline :: builder ( & room)
129
- . events ( self . inner . prev_batch . clone ( ) , self . timeline_queue . clone ( ) ) ,
134
+ . events ( self . prev_batch ( ) . cloned ( ) , self . timeline_queue . clone ( ) ) ,
130
135
)
131
136
} else if let Some ( invited_room) = self . client . get_invited_room ( & self . room_id ) {
132
137
Some ( Timeline :: builder ( & invited_room) . events ( None , Vector :: new ( ) ) )
@@ -383,6 +388,12 @@ mod tests {
383
388
receives room_response!( { "highlight_count" : 42 } ) ;
384
389
_ = Some ( uint!( 42 ) ) ;
385
390
}
391
+
392
+ test_prev_batch {
393
+ prev_batch( ) = None ;
394
+ receives room_response!( { "prev_batch" : "t111_222_333" } ) ;
395
+ _ = Some ( & "t111_222_333" . to_string( ) ) ;
396
+ }
386
397
}
387
398
388
399
#[ tokio:: test]
You can’t perform that action at this time.
0 commit comments