mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 03:16:29 +03:00
Move prune_tombstones() to sql:: and call from housekeeping()
This commit is contained in:
12
src/chat.rs
12
src/chat.rs
@@ -2529,18 +2529,6 @@ pub fn delete_device_expired_messages(context: &Context) -> sql::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Removes from the database locally deleted messages that also don't
|
||||
/// have a server UID.
|
||||
pub fn prune_tombstones(context: &Context) -> sql::Result<()> {
|
||||
context.sql.execute(
|
||||
"DELETE FROM msgs \
|
||||
WHERE (chat_id = ? OR hidden) \
|
||||
AND server_uid = 0",
|
||||
params![DC_CHAT_ID_TRASH],
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user