mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
add 'estimatedeletion' to repl tool
This commit is contained in:
committed by
Alexander Krotov
parent
d1a4c82937
commit
aea8a32ba5
@@ -397,6 +397,7 @@ pub fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::Error> {
|
|||||||
providerinfo <addr>\n\
|
providerinfo <addr>\n\
|
||||||
event <event-id to test>\n\
|
event <event-id to test>\n\
|
||||||
fileinfo <file>\n\
|
fileinfo <file>\n\
|
||||||
|
estimatedeletion <seconds>\n\
|
||||||
emptyserver <flags> (1=MVBOX 2=INBOX)\n\
|
emptyserver <flags> (1=MVBOX 2=INBOX)\n\
|
||||||
clear -- clear screen\n\
|
clear -- clear screen\n\
|
||||||
exit or quit\n\
|
exit or quit\n\
|
||||||
@@ -1028,6 +1029,16 @@ pub fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::Error> {
|
|||||||
bail!("Command failed.");
|
bail!("Command failed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"estimatedeletion" => {
|
||||||
|
ensure!(!arg1.is_empty(), "Argument <seconds> missing");
|
||||||
|
let seconds = arg1.parse()?;
|
||||||
|
let device_cnt = message::estimate_deletion_cnt(context, false, seconds)?;
|
||||||
|
let server_cnt = message::estimate_deletion_cnt(context, true, seconds)?;
|
||||||
|
println!(
|
||||||
|
"estimated count of messages older than {} seconds:\non device: {}\non server: {}",
|
||||||
|
seconds, device_cnt, server_cnt
|
||||||
|
);
|
||||||
|
}
|
||||||
"emptyserver" => {
|
"emptyserver" => {
|
||||||
ensure!(!arg1.is_empty(), "Argument <flags> missing");
|
ensure!(!arg1.is_empty(), "Argument <flags> missing");
|
||||||
|
|
||||||
|
|||||||
@@ -308,8 +308,17 @@ const CONTACT_COMMANDS: [&str; 6] = [
|
|||||||
"delcontact",
|
"delcontact",
|
||||||
"cleanupcontacts",
|
"cleanupcontacts",
|
||||||
];
|
];
|
||||||
const MISC_COMMANDS: [&str; 9] = [
|
const MISC_COMMANDS: [&str; 10] = [
|
||||||
"getqr", "getbadqr", "checkqr", "event", "fileinfo", "clear", "exit", "quit", "help",
|
"getqr",
|
||||||
|
"getbadqr",
|
||||||
|
"checkqr",
|
||||||
|
"event",
|
||||||
|
"fileinfo",
|
||||||
|
"clear",
|
||||||
|
"exit",
|
||||||
|
"quit",
|
||||||
|
"help",
|
||||||
|
"estimatedeletion",
|
||||||
];
|
];
|
||||||
|
|
||||||
impl Hinter for DcHelper {
|
impl Hinter for DcHelper {
|
||||||
|
|||||||
Reference in New Issue
Block a user