Resultify MsgId.delete_from_db()

This commit is contained in:
Alexander Krotov
2020-02-25 22:47:59 +03:00
parent bc06b9e051
commit f2aa17c9d0
3 changed files with 6 additions and 10 deletions

View File

@@ -100,7 +100,7 @@ impl MsgId {
}
/// 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) -> crate::sql::Result<()> {
// We don't use transactions yet, so remove MDNs first to make
// sure they are not left while the message is deleted.
sql::execute(
@@ -108,15 +108,14 @@ impl MsgId {
&context.sql,
"DELETE FROM msgs_mdns WHERE msg_id=?;",
params![self],
)
.ok();
)?;
sql::execute(
context,
&context.sql,
"DELETE FROM msgs WHERE id=?;",
params![self],
)
.ok();
)?;
Ok(())
}
/// Removes IMAP server UID and folder from the database record.