File tree 2 files changed +7
-11
lines changed
crates/matrix-sdk/src/sliding_sync
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 1
- use std:: {
2
- collections:: BTreeMap ,
3
- fmt:: Debug ,
4
- sync:: { Mutex , RwLock as StdRwLock } ,
5
- } ;
1
+ use std:: { collections:: BTreeMap , fmt:: Debug , sync:: RwLock as StdRwLock } ;
6
2
7
3
use ruma:: {
8
4
api:: client:: sync:: sync_events:: v4:: {
@@ -264,7 +260,7 @@ impl SlidingSyncBuilder {
264
260
rooms,
265
261
bump_event_types : self . bump_event_types ,
266
262
267
- extensions : Mutex :: new ( self . extensions ) ,
263
+ extensions : self . extensions . unwrap_or_default ( ) ,
268
264
reset_counter : Default :: default ( ) ,
269
265
270
266
position : StdRwLock :: new ( SlidingSyncPositionMarkers {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ use std::{
27
27
fmt:: Debug ,
28
28
sync:: {
29
29
atomic:: { AtomicU8 , Ordering } ,
30
- Arc , Mutex , RwLock as StdRwLock ,
30
+ Arc , RwLock as StdRwLock ,
31
31
} ,
32
32
time:: Duration ,
33
33
} ;
@@ -116,9 +116,9 @@ pub(super) struct SlidingSyncInner {
116
116
/// Number of times a Sliding Sync session has been reset.
117
117
reset_counter : AtomicU8 ,
118
118
119
- /// The intended state of the extensions being supplied to Sliding Sync
120
- /// calls .
121
- extensions : Mutex < Option < ExtensionsConfig > > ,
119
+ /// Static configuration for extensions, passed in the slidinc sync
120
+ /// requests .
121
+ extensions : ExtensionsConfig ,
122
122
123
123
/// Internal channel used to pass messages between Sliding Sync and other
124
124
/// types.
@@ -260,7 +260,7 @@ impl SlidingSync {
260
260
}
261
261
262
262
fn prepare_extension_config ( & self , pos : Option < & str > ) -> ExtensionsConfig {
263
- let mut extensions = { self . inner . extensions . lock ( ) . unwrap ( ) . clone ( ) . unwrap_or_default ( ) } ;
263
+ let mut extensions = self . inner . extensions . clone ( ) ;
264
264
265
265
if pos. is_none ( ) {
266
266
// The pos is `None`, it's either our initial sync or the proxy forgot about us
You can’t perform that action at this time.
0 commit comments