mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
@@ -428,7 +428,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
send <text>\n\
|
send <text>\n\
|
||||||
send-garbage\n\
|
send-garbage\n\
|
||||||
sendimage <file> [<text>]\n\
|
sendimage <file> [<text>]\n\
|
||||||
sendfile <file>\n\
|
sendfile <file> [<text>]\n\
|
||||||
draft [<text>]\n\
|
draft [<text>]\n\
|
||||||
listmedia\n\
|
listmedia\n\
|
||||||
archive <chat-id>\n\
|
archive <chat-id>\n\
|
||||||
@@ -862,7 +862,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
}
|
}
|
||||||
"sendimage" | "sendfile" => {
|
"sendimage" | "sendfile" => {
|
||||||
ensure!(sel_chat.is_some(), "No chat selected.");
|
ensure!(sel_chat.is_some(), "No chat selected.");
|
||||||
ensure!(!arg1.is_empty() && !arg2.is_empty(), "No file given.");
|
ensure!(!arg1.is_empty(), "No file given.");
|
||||||
|
|
||||||
let mut msg = dc_msg_new(
|
let mut msg = dc_msg_new(
|
||||||
context,
|
context,
|
||||||
@@ -873,7 +873,9 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
dc_msg_set_file(&mut msg, arg1_c, ptr::null());
|
dc_msg_set_file(&mut msg, arg1_c, ptr::null());
|
||||||
dc_msg_set_text(&mut msg, arg2_c);
|
if !arg2.is_empty() {
|
||||||
|
dc_msg_set_text(&mut msg, arg2_c);
|
||||||
|
}
|
||||||
chat::send_msg(context, sel_chat.as_ref().unwrap().get_id(), &mut msg)?;
|
chat::send_msg(context, sel_chat.as_ref().unwrap().get_id(), &mut msg)?;
|
||||||
}
|
}
|
||||||
"listmsgs" => {
|
"listmsgs" => {
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ impl<'a> Chat<'a> {
|
|||||||
timestamp,
|
timestamp,
|
||||||
msg.type_0,
|
msg.type_0,
|
||||||
msg.state,
|
msg.state,
|
||||||
msg.text,
|
msg.text.as_ref().map_or("", String::as_str),
|
||||||
msg.param.to_string(),
|
msg.param.to_string(),
|
||||||
msg.hidden,
|
msg.hidden,
|
||||||
to_string(new_in_reply_to),
|
to_string(new_in_reply_to),
|
||||||
|
|||||||
@@ -478,8 +478,7 @@ pub fn dc_msg_load_from_db<'a>(context: &'a Context, id: u32) -> Result<Message<
|
|||||||
text = String::from_utf8_lossy(buf).into_owned();
|
text = String::from_utf8_lossy(buf).into_owned();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
warn!(context, 0, "dc_msg_load_from_db: could not get text column for id {}", id);
|
text = "".to_string();
|
||||||
text = "[ Could not read from db ]".to_string();
|
|
||||||
}
|
}
|
||||||
msg.text = Some(text);
|
msg.text = Some(text);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user