mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 22:46:29 +03:00
Delete messages more thoroughly (and at all) (#2114)
- Make sure delete_expired_messages and housekeeping runs once a day - delete more info about messages when putting them to trash (esp. also delete txt_raw, from_id and to_id as we don't need those anymore, so they are data that was unnecessarily kept) fix #1926, fix #2090 Also: * Nicer test_utils: add send_text() and print_chat() * Adapt ephemeral messages for testing (make them accurate to the second) * Add test for ephemeral messages * Make pop_sent_msg() really pop the last sent message
This commit is contained in:
@@ -136,6 +136,9 @@ pub enum Config {
|
||||
|
||||
/// address to webrtc instance to use for videochats
|
||||
WebrtcInstance,
|
||||
|
||||
/// Timestamp of the last time housekeeping was run
|
||||
LastHousekeeping,
|
||||
}
|
||||
|
||||
impl Context {
|
||||
@@ -175,6 +178,13 @@ impl Context {
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub async fn get_config_i64(&self, key: Config) -> i64 {
|
||||
self.get_config(key)
|
||||
.await
|
||||
.and_then(|s| s.parse().ok())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub async fn get_config_bool(&self, key: Config) -> bool {
|
||||
self.get_config_int(key).await != 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user