checkpoint 3

This commit is contained in:
Simon Laux
2020-03-10 02:44:29 +01:00
committed by Simon
parent 817050260f
commit 9f24d57835
4 changed files with 22 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ use deltachat::dc_tools::*;
use deltachat::error::Error;
use deltachat::imex::*;
use deltachat::job::*;
use deltachat::export_chat::export_chat;
use deltachat::location;
use deltachat::lot::LotState;
use deltachat::message::{self, Message, MessageState, MsgId};
@@ -374,6 +375,7 @@ pub fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::Error> {
pin <chat-id>\n\
unpin <chat-id>\n\
delchat <chat-id>\n\
export-chat <chat-id>\n\
===========================Message commands==\n\
listmsgs <query>\n\
msginfo <msg-id>\n\
@@ -868,6 +870,12 @@ pub fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::Error> {
let chat_id = ChatId::new(arg1.parse()?);
chat_id.delete(context)?;
}
"export-chat" => {
ensure!(!arg1.is_empty(), "Argument <chat-id> missing.");
let chat_id = ChatId::new(arg1.parse()?);
let res = export_chat(context, chat_id);
println!("{:?}", res);
}
"msginfo" => {
ensure!(!arg1.is_empty(), "Argument <msg-id> missing.");
let id = MsgId::new(arg1.parse()?);

View File

@@ -262,7 +262,7 @@ const DB_COMMANDS: [&str; 11] = [
"housekeeping",
];
const CHAT_COMMANDS: [&str; 26] = [
const CHAT_COMMANDS: [&str; 27] = [
"listchats",
"listarchived",
"chat",
@@ -289,6 +289,7 @@ const CHAT_COMMANDS: [&str; 26] = [
"pin",
"unpin",
"delchat",
"export-chat",
];
const MESSAGE_COMMANDS: [&str; 8] = [
"listmsgs",