mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 20:06: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.
|
/// Deletes a message and corresponding MDNs from the database.
|
||||||
pub fn delete_from_db(self, context: &Context) {
|
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(
|
sql::execute(
|
||||||
context,
|
context,
|
||||||
&context.sql,
|
&context.sql,
|
||||||
"DELETE FROM msgs WHERE id=?;",
|
"DELETE FROM msgs_mdns WHERE msg_id=?;",
|
||||||
params![self],
|
params![self],
|
||||||
)
|
)
|
||||||
.ok();
|
.ok();
|
||||||
sql::execute(
|
sql::execute(
|
||||||
context,
|
context,
|
||||||
&context.sql,
|
&context.sql,
|
||||||
"DELETE FROM msgs_mdns WHERE msg_id=?;",
|
"DELETE FROM msgs WHERE id=?;",
|
||||||
params![self],
|
params![self],
|
||||||
)
|
)
|
||||||
.ok();
|
.ok();
|
||||||
|
|||||||
Reference in New Issue
Block a user