mirror of
https://github.com/chatmail/core.git
synced 2026-05-21 07:46:31 +03:00
Add Context.get_config_delete_device_after() method
In contrast to get_config_delete_server_after(), value 1 does not mean "delete at once", because it does not make sense to delete messages immediately after receivning them.
This commit is contained in:
@@ -159,6 +159,17 @@ impl Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gets configured "delete_device_after" value.
|
||||||
|
///
|
||||||
|
/// `None` means never delete the message, `Some(x)` means delete
|
||||||
|
/// after `x` seconds.
|
||||||
|
pub fn get_config_delete_device_after(&self) -> Option<i64> {
|
||||||
|
match self.get_config_int(Config::DeleteDeviceAfter) {
|
||||||
|
0 => None,
|
||||||
|
x => Some(x as i64),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Set the given config key.
|
/// Set the given config key.
|
||||||
/// If `None` is passed as a value the value is cleared and set to the default if there is one.
|
/// If `None` is passed as a value the value is cleared and set to the default if there is one.
|
||||||
pub fn set_config(&self, key: Config, value: Option<&str>) -> crate::sql::Result<()> {
|
pub fn set_config(&self, key: Config, value: Option<&str>) -> crate::sql::Result<()> {
|
||||||
|
|||||||
Reference in New Issue
Block a user