13
13
// See the License for the specific language governing permissions and
14
14
// limitations under the License.
15
15
16
- #[ cfg( feature = "e2e-encryption" ) ]
17
- use std:: ops:: Deref ;
18
16
use std:: {
19
17
collections:: { BTreeMap , BTreeSet , HashMap , HashSet } ,
20
18
fmt, iter,
21
- sync:: Arc ,
22
19
} ;
20
+ #[ cfg( feature = "e2e-encryption" ) ]
21
+ use std:: { ops:: Deref , sync:: Arc } ;
23
22
24
23
use eyeball:: { SharedObservable , Subscriber } ;
25
24
#[ cfg( not( target_arch = "wasm32" ) ) ]
@@ -71,7 +70,7 @@ use crate::RoomMemberships;
71
70
use crate :: {
72
71
deserialized_responses:: { RawAnySyncOrStrippedTimelineEvent , SyncTimelineEvent } ,
73
72
error:: { Error , Result } ,
74
- event_cache_store:: DynEventCacheStore ,
73
+ event_cache_store:: EventCacheStoreWrapper ,
75
74
rooms:: {
76
75
normal:: { RoomInfoNotableUpdate , RoomInfoNotableUpdateReasons } ,
77
76
Room , RoomInfo , RoomState ,
@@ -93,7 +92,7 @@ pub struct BaseClient {
93
92
/// Database
94
93
pub ( crate ) store : Store ,
95
94
/// The store used by the event cache.
96
- event_cache_store : Arc < DynEventCacheStore > ,
95
+ event_cache_store : EventCacheStoreWrapper ,
97
96
/// The store used for encryption.
98
97
///
99
98
/// This field is only meant to be used for `OlmMachine` initialization.
@@ -147,7 +146,7 @@ impl BaseClient {
147
146
148
147
BaseClient {
149
148
store : Store :: new ( config. state_store ) ,
150
- event_cache_store : config. event_cache_store ,
149
+ event_cache_store : EventCacheStoreWrapper :: new ( config. event_cache_store ) ,
151
150
#[ cfg( feature = "e2e-encryption" ) ]
152
151
crypto_store : config. crypto_store ,
153
152
#[ cfg( feature = "e2e-encryption" ) ]
@@ -222,8 +221,8 @@ impl BaseClient {
222
221
}
223
222
224
223
/// Get a reference to the event cache store.
225
- pub fn event_cache_store ( & self ) -> & DynEventCacheStore {
226
- & * self . event_cache_store
224
+ pub fn event_cache_store ( & self ) -> & EventCacheStoreWrapper {
225
+ & self . event_cache_store
227
226
}
228
227
229
228
/// Is the client logged in.
0 commit comments