mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
Remove last mutable variable from do_set_draft
This commit is contained in:
@@ -871,7 +871,6 @@ fn maybe_delete_draft(context: &Context, chat_id: u32) -> bool {
|
|||||||
///
|
///
|
||||||
/// Return true on success, false on database error.
|
/// Return true on success, false on database error.
|
||||||
fn do_set_draft(context: &Context, chat_id: u32, msg: &mut Message) -> bool {
|
fn do_set_draft(context: &Context, chat_id: u32, msg: &mut Message) -> bool {
|
||||||
let mut sth_changed = false;
|
|
||||||
|
|
||||||
match msg.type_0 {
|
match msg.type_0 {
|
||||||
Viewtype::Unknown => return false,
|
Viewtype::Unknown => return false,
|
||||||
@@ -891,8 +890,7 @@ fn do_set_draft(context: &Context, chat_id: u32, msg: &mut Message) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
sql::execute(
|
||||||
if sql::execute(
|
|
||||||
context,
|
context,
|
||||||
&context.sql,
|
&context.sql,
|
||||||
"INSERT INTO msgs (chat_id, from_id, timestamp, type, state, txt, param, hidden) \
|
"INSERT INTO msgs (chat_id, from_id, timestamp, type, state, txt, param, hidden) \
|
||||||
@@ -909,11 +907,6 @@ fn do_set_draft(context: &Context, chat_id: u32, msg: &mut Message) -> bool {
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
.is_ok()
|
.is_ok()
|
||||||
{
|
|
||||||
sth_changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sth_changed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// similar to as dc_set_draft() but does not emit an event
|
// similar to as dc_set_draft() but does not emit an event
|
||||||
|
|||||||
Reference in New Issue
Block a user