Skip to content

Commit 116003a

Browse files
committed
refactor(base): Rename clone_with_in_memory_state_store.
This patch renames `clone_with_in_memory_state_store` to `derive_states_for_notification_client`. At least it clarifies what it does.
1 parent 7a4263d commit 116003a

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

crates/matrix-sdk-base/src/client.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,18 @@ impl BaseClient {
213213
}
214214
}
215215

216-
/// Clones the current base client to use the same crypto store but a
217-
/// different, in-memory store config, and resets transient state.
216+
/// Derives the current states but for a notification client.
217+
///
218+
/// The stores will be as follow:
219+
///
220+
/// - state store will be in-memory only,
221+
/// - event cache store will be cloned (it's behind a cross-process lock),
222+
/// - media store will be cloned (it's behind a cross-process lock),
223+
/// - crypto store will be cloned (custom mechanism for the moment).
224+
///
225+
/// The transient state will be reset.
218226
#[cfg(feature = "e2e-encryption")]
219-
pub async fn clone_with_in_memory_state_store(
227+
pub async fn derive_states_for_notification_client(
220228
&self,
221229
cross_process_store_locks_holder_name: &str,
222230
handle_verification_events: bool,

crates/matrix-sdk/src/client/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3054,7 +3054,10 @@ impl Client {
30543054
self.inner.http_client.clone(),
30553055
self.inner
30563056
.base_client
3057-
.clone_with_in_memory_state_store(&cross_process_store_locks_holder_name, false)
3057+
.derive_states_for_notification_client(
3058+
&cross_process_store_locks_holder_name,
3059+
false,
3060+
)
30583061
.await?,
30593062
self.inner.caches.supported_versions.read().await.clone(),
30603063
self.inner.caches.well_known.read().await.clone(),

0 commit comments

Comments
 (0)