task(sdk): expose the SqliteEventCacheStore from the SDK crate

And use it in multiverse.
This commit is contained in:
Benjamin Bouvier
2024-11-21 12:41:39 +01:00
parent 9d6ffa951f
commit edc93e62b4
2 changed files with 7 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ pub use http_client::TransmissionProgress;
#[cfg(all(feature = "e2e-encryption", feature = "sqlite"))]
pub use matrix_sdk_sqlite::SqliteCryptoStore;
#[cfg(feature = "sqlite")]
pub use matrix_sdk_sqlite::SqliteStateStore;
pub use matrix_sdk_sqlite::{SqliteEventCacheStore, SqliteStateStore};
pub use media::Media;
pub use pusher::Pusher;
pub use room::Room;

View File

@@ -25,7 +25,7 @@ use matrix_sdk::{
events::room::message::{MessageType, RoomMessageEventContent},
MilliSecondsSinceUnixEpoch, OwnedRoomId, RoomId,
},
AuthSession, Client, ServerName, SqliteCryptoStore, SqliteStateStore,
AuthSession, Client, ServerName, SqliteCryptoStore, SqliteEventCacheStore, SqliteStateStore,
};
use matrix_sdk_ui::{
room_list_service::{self, filters::new_filter_non_left},
@@ -949,10 +949,11 @@ async fn configure_client(server_name: String, config_path: String) -> anyhow::R
let mut client_builder = Client::builder()
.store_config(
StoreConfig::new("multiverse".to_owned())
.crypto_store(
SqliteCryptoStore::open(config_path.join("crypto.sqlite"), None).await?,
)
.state_store(SqliteStateStore::open(config_path.join("state.sqlite"), None).await?),
.crypto_store(SqliteCryptoStore::open(config_path.join("crypto"), None).await?)
.state_store(SqliteStateStore::open(config_path.join("state"), None).await?)
.event_cache_store(
SqliteEventCacheStore::open(config_path.join("cache"), None).await?,
),
)
.server_name(&server_name)
.with_encryption_settings(EncryptionSettings {