mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +03:00
Delete MDNs first in MsgId.delete_from_db()
This commit is contained in:
@@ -101,17 +101,19 @@ impl MsgId {
|
||||
|
||||
/// Deletes a message and corresponding MDNs from the database.
|
||||
pub fn delete_from_db(self, context: &Context) {
|
||||
// We don't use transactions yet, so remove MDNs first to make
|
||||
// sure they are not left while the message is deleted.
|
||||
sql::execute(
|
||||
context,
|
||||
&context.sql,
|
||||
"DELETE FROM msgs WHERE id=?;",
|
||||
"DELETE FROM msgs_mdns WHERE msg_id=?;",
|
||||
params![self],
|
||||
)
|
||||
.ok();
|
||||
sql::execute(
|
||||
context,
|
||||
&context.sql,
|
||||
"DELETE FROM msgs_mdns WHERE msg_id=?;",
|
||||
"DELETE FROM msgs WHERE id=?;",
|
||||
params![self],
|
||||
)
|
||||
.ok();
|
||||
|
||||
Reference in New Issue
Block a user