Commit d91e1b28a3
Unsigned
Layout: unified · split
README.md +9
| @@ -170,6 +170,15 @@ The inactivity delay defaults to five minutes and can be changed with: | ||
| 170 | 170 | |
| 171 | 171 | /set matrix-rust.look.smart_filter_delay 300000 |
| 172 | 172 | |
| 173 | # Storage | |
| 174 | ||
| 175 | The 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 | ||
| 179 | If the cache grows or causes too much disk I/O, disconnect WeeChat and remove | |
| 180 | only the `-cache` directory. Do not remove the main server directory unless you | |
| 181 | want to reset stored Matrix state. | |
| 173 | 182 | |
| 174 | 183 | # Helpful Commands |
| 175 | 184 | |
src/server.rs +14 −1
| @@ -963,6 +963,15 @@ impl InnerServer { | ||
| 963 | 963 | path |
| 964 | 964 | } |
| 965 | 965 | |
| 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 | ||
| 966 | 975 | pub fn connection(&self) -> Option<Connection> { |
| 967 | 976 | self.connection.borrow().clone() |
| 968 | 977 | } |
| @@ -987,7 +996,11 @@ impl InnerServer { | ||
| 987 | 996 | |
| 988 | 997 | let mut client_builder = Client::builder() |
| 989 | 998 | .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 | ); | |
| 991 | 1004 | |
| 992 | 1005 | if let Some(proxy) = settings.proxy.as_ref() { |
| 993 | 1006 | client_builder = client_builder.proxy(proxy); |