mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
Trash messages more thoroughly (#2273)
Esp. remove some information for newly-arriving messages
This commit is contained in:
@@ -147,13 +147,17 @@ impl MsgId {
|
||||
|
||||
/// Put message into trash chat and delete message text.
|
||||
///
|
||||
/// It means the message is deleted locally, but not on the server
|
||||
/// yet.
|
||||
/// It means the message is deleted locally, but not on the server.
|
||||
/// We keep some infos to
|
||||
/// 1. not download the same message again
|
||||
/// 2. be able to delete the message on the server if we want to
|
||||
pub async fn trash(self, context: &Context) -> crate::sql::Result<()> {
|
||||
let chat_id = ChatId::new(DC_CHAT_ID_TRASH);
|
||||
context
|
||||
.sql
|
||||
.execute(
|
||||
// If you change which information is removed here, also change delete_expired_messages() and
|
||||
// which information dc_receive_imf::add_parts() still adds to the db if the chat_id is TRASH
|
||||
"UPDATE msgs SET chat_id=?, txt='', txt_raw='', mime_headers='', from_id=0, to_id=0, param='' WHERE id=?",
|
||||
paramsv![chat_id, self],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user