Commit d91e1b28a3

d91e1b28a3be72bc5ef1f128ccebaf69df2b5ae1

parent: 7d72c81afd

Unsigned

Darafei Praliaskouski <me@komzpa.net> · 2026-06-23 20:54 UTC
committer: <strk@kbt.io>

fix: split Matrix SDK event cache storage

Layout: unified · split

README.md +9
@@ -170,6 +170,15 @@ The inactivity delay defaults to five minutes and can be changed with:
170170
171171 /set matrix-rust.look.smart_filter_delay 300000
172172
173# Storage
174
175The plugin keeps Matrix state and encryption data in
176`$WEECHAT_HOME/matrix-rust/<server>/`. It keeps the Matrix SDK event cache in
177`$WEECHAT_HOME/matrix-rust/<server>-cache/`.
178
179If the cache grows or causes too much disk I/O, disconnect WeeChat and remove
180only the `-cache` directory. Do not remove the main server directory unless you
181want to reset stored Matrix state.
173182
174183# Helpful Commands
175184
src/server.rs +14 −1
@@ -963,6 +963,15 @@ impl InnerServer {
963963 path
964964 }
965965
966 fn get_server_cache_path(&self) -> PathBuf {
967 let mut path = Weechat::home_dir();
968 let server_name: &str = &self.server_name;
969 path.push("matrix-rust");
970 path.push(format!("{}-cache", server_name));
971
972 path
973 }
974
966975 pub fn connection(&self) -> Option<Connection> {
967976 self.connection.borrow().clone()
968977 }
@@ -987,7 +996,11 @@ impl InnerServer {
987996
988997 let mut client_builder = Client::builder()
989998 .homeserver_url(homeserver)
990 .sqlite_store(self.get_server_path(), Some("DEFAULT_PASSPHRASE"));
999 .sqlite_store_with_cache_path(
1000 self.get_server_path(),
1001 self.get_server_cache_path(),
1002 Some("DEFAULT_PASSPHRASE"),
1003 );
9911004
9921005 if let Some(proxy) = settings.proxy.as_ref() {
9931006 client_builder = client_builder.proxy(proxy);