mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
@@ -428,7 +428,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
||||
send <text>\n\
|
||||
send-garbage\n\
|
||||
sendimage <file> [<text>]\n\
|
||||
sendfile <file>\n\
|
||||
sendfile <file> [<text>]\n\
|
||||
draft [<text>]\n\
|
||||
listmedia\n\
|
||||
archive <chat-id>\n\
|
||||
@@ -862,7 +862,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
||||
}
|
||||
"sendimage" | "sendfile" => {
|
||||
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(
|
||||
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_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)?;
|
||||
}
|
||||
"listmsgs" => {
|
||||
|
||||
@@ -502,7 +502,7 @@ impl<'a> Chat<'a> {
|
||||
timestamp,
|
||||
msg.type_0,
|
||||
msg.state,
|
||||
msg.text,
|
||||
msg.text.as_ref().map_or("", String::as_str),
|
||||
msg.param.to_string(),
|
||||
msg.hidden,
|
||||
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();
|
||||
}
|
||||
} else {
|
||||
warn!(context, 0, "dc_msg_load_from_db: could not get text column for id {}", id);
|
||||
text = "[ Could not read from db ]".to_string();
|
||||
text = "".to_string();
|
||||
}
|
||||
msg.text = Some(text);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user