mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
Interrupt ephemeral loop when delete_device_after is set
This commit is contained in:
@@ -5,12 +5,10 @@ use strum::{EnumProperty, IntoEnumIterator};
|
|||||||
use strum_macros::{AsRefStr, Display, EnumIter, EnumProperty, EnumString};
|
use strum_macros::{AsRefStr, Display, EnumIter, EnumProperty, EnumString};
|
||||||
|
|
||||||
use crate::blob::BlobObject;
|
use crate::blob::BlobObject;
|
||||||
use crate::chat::ChatId;
|
|
||||||
use crate::constants::DC_VERSION_STR;
|
use crate::constants::DC_VERSION_STR;
|
||||||
use crate::context::Context;
|
use crate::context::Context;
|
||||||
use crate::dc_tools::{dc_get_abs_path, improve_single_line_input};
|
use crate::dc_tools::{dc_get_abs_path, improve_single_line_input};
|
||||||
use crate::events::EventType;
|
use crate::events::EventType;
|
||||||
use crate::message::MsgId;
|
|
||||||
use crate::mimefactory::RECOMMENDED_FILE_SIZE;
|
use crate::mimefactory::RECOMMENDED_FILE_SIZE;
|
||||||
use crate::provider::{get_provider_by_id, Provider};
|
use crate::provider::{get_provider_by_id, Provider};
|
||||||
|
|
||||||
@@ -293,11 +291,8 @@ impl Context {
|
|||||||
}
|
}
|
||||||
Config::DeleteDeviceAfter => {
|
Config::DeleteDeviceAfter => {
|
||||||
let ret = self.sql.set_raw_config(key, value).await;
|
let ret = self.sql.set_raw_config(key, value).await;
|
||||||
// Force chatlist reload to delete old messages immediately.
|
// Interrupt ephemeral loop to delete old messages immediately.
|
||||||
self.emit_event(EventType::MsgsChanged {
|
self.interrupt_ephemeral_task().await;
|
||||||
msg_id: MsgId::new(0),
|
|
||||||
chat_id: ChatId::new(0),
|
|
||||||
});
|
|
||||||
ret?
|
ret?
|
||||||
}
|
}
|
||||||
Config::Displayname => {
|
Config::Displayname => {
|
||||||
|
|||||||
Reference in New Issue
Block a user