From f436e915d3de5cdebd64d9445358be6468680722 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Wed, 27 Mar 2024 03:37:33 -0300 Subject: [PATCH] fix: housekeeping: Delete MDNs and webxdc status updates for tombstones --- src/sql.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sql.rs b/src/sql.rs index f85213851..b6a42f767 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -762,8 +762,9 @@ pub async fn housekeeping(context: &Context) -> Result<()> { context .sql .execute( - "DELETE FROM msgs_mdns WHERE msg_id NOT IN (SELECT id FROM msgs)", - (), + "DELETE FROM msgs_mdns WHERE msg_id NOT IN \ + (SELECT id FROM msgs WHERE chat_id!=?)", + (DC_CHAT_ID_TRASH,), ) .await .context("failed to remove old MDNs") @@ -773,8 +774,9 @@ pub async fn housekeeping(context: &Context) -> Result<()> { context .sql .execute( - "DELETE FROM msgs_status_updates WHERE msg_id NOT IN (SELECT id FROM msgs)", - (), + "DELETE FROM msgs_status_updates WHERE msg_id NOT IN \ + (SELECT id FROM msgs WHERE chat_id!=?)", + (DC_CHAT_ID_TRASH,), ) .await .context("failed to remove old webxdc status updates")