mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 16:36:59 +03:00
cargo-fmt
This commit is contained in:
72
src/chat.rs
72
src/chat.rs
@@ -874,45 +874,43 @@ unsafe fn set_draft_raw(context: &Context, chat_id: u32, msg: &mut Message) -> b
|
|||||||
|
|
||||||
let mut sth_changed = maybe_delete_draft(context, chat_id);
|
let mut sth_changed = maybe_delete_draft(context, chat_id);
|
||||||
|
|
||||||
{
|
// save new draft
|
||||||
// save new draft
|
if msg.type_0 == Viewtype::Text {
|
||||||
if msg.type_0 == Viewtype::Text {
|
OK_TO_CONTINUE = msg.text.as_ref().map_or(false, |s| !s.is_empty());
|
||||||
OK_TO_CONTINUE = msg.text.as_ref().map_or(false, |s| !s.is_empty());
|
} else if msgtype_has_file(msg.type_0) {
|
||||||
} else if msgtype_has_file(msg.type_0) {
|
if let Some(path_filename) = msg.param.get(Param::File) {
|
||||||
if let Some(path_filename) = msg.param.get(Param::File) {
|
let mut path_filename = path_filename.to_string();
|
||||||
let mut path_filename = path_filename.to_string();
|
if dc_msg_is_increation(msg) && !dc_is_blobdir_path(context, &path_filename) {
|
||||||
if dc_msg_is_increation(msg) && !dc_is_blobdir_path(context, &path_filename) {
|
OK_TO_CONTINUE = false;
|
||||||
OK_TO_CONTINUE = false;
|
} else if !dc_make_rel_and_copy(context, &mut path_filename) {
|
||||||
} else if !dc_make_rel_and_copy(context, &mut path_filename) {
|
OK_TO_CONTINUE = false;
|
||||||
OK_TO_CONTINUE = false;
|
} else {
|
||||||
} else {
|
msg.param.set(Param::File, path_filename);
|
||||||
msg.param.set(Param::File, path_filename);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
OK_TO_CONTINUE = false;
|
|
||||||
}
|
}
|
||||||
if OK_TO_CONTINUE {
|
} else {
|
||||||
if sql::execute(
|
OK_TO_CONTINUE = false;
|
||||||
context,
|
}
|
||||||
&context.sql,
|
if OK_TO_CONTINUE {
|
||||||
"INSERT INTO msgs (chat_id, from_id, timestamp, type, state, txt, param, hidden) \
|
if sql::execute(
|
||||||
VALUES (?,?,?, ?,?,?,?,?);",
|
context,
|
||||||
params![
|
&context.sql,
|
||||||
chat_id as i32,
|
"INSERT INTO msgs (chat_id, from_id, timestamp, type, state, txt, param, hidden) \
|
||||||
1,
|
VALUES (?,?,?, ?,?,?,?,?);",
|
||||||
time(),
|
params![
|
||||||
msg.type_0,
|
chat_id as i32,
|
||||||
MessageState::OutDraft,
|
1,
|
||||||
msg.text.as_ref().map(String::as_str).unwrap_or(""),
|
time(),
|
||||||
msg.param.to_string(),
|
msg.type_0,
|
||||||
1,
|
MessageState::OutDraft,
|
||||||
],
|
msg.text.as_ref().map(String::as_str).unwrap_or(""),
|
||||||
)
|
msg.param.to_string(),
|
||||||
.is_ok()
|
1,
|
||||||
{
|
],
|
||||||
sth_changed = true;
|
)
|
||||||
}
|
.is_ok()
|
||||||
|
{
|
||||||
|
sth_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sth_changed
|
sth_changed
|
||||||
|
|||||||
Reference in New Issue
Block a user