mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
remove dead code
This commit is contained in:
committed by
holger krekel
parent
5663c7dec3
commit
c603ca0e7a
@@ -342,12 +342,6 @@ unsafe fn log_contactlist(context: &Context, contacts: &Vec<u32>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static mut S_IS_AUTH: libc::c_int = 0;
|
|
||||||
|
|
||||||
pub unsafe fn dc_cmdline_skip_auth() {
|
|
||||||
S_IS_AUTH = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn chat_prefix(chat: &Chat) -> &'static str {
|
fn chat_prefix(chat: &Chat) -> &'static str {
|
||||||
chat.typ.into()
|
chat.typ.into()
|
||||||
}
|
}
|
||||||
@@ -461,20 +455,6 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
============================================="
|
============================================="
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
"auth" => {
|
|
||||||
if 0 == S_IS_AUTH {
|
|
||||||
let is_pw = context
|
|
||||||
.get_config(config::Config::MailPw)
|
|
||||||
.unwrap_or_default();
|
|
||||||
if arg1 == is_pw {
|
|
||||||
S_IS_AUTH = 1;
|
|
||||||
} else {
|
|
||||||
println!("Bad password.");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
println!("Already authorized.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"open" => {
|
"open" => {
|
||||||
ensure!(!arg1.is_empty(), "Argument <file> missing");
|
ensure!(!arg1.is_empty(), "Argument <file> missing");
|
||||||
dc_close(context);
|
dc_close(context);
|
||||||
|
|||||||
@@ -389,8 +389,6 @@ impl Helper for DcHelper {}
|
|||||||
fn main_0(args: Vec<String>) -> Result<(), failure::Error> {
|
fn main_0(args: Vec<String>) -> Result<(), failure::Error> {
|
||||||
let mut context = dc_context_new(Some(receive_event), ptr::null_mut(), Some("CLI".into()));
|
let mut context = dc_context_new(Some(receive_event), ptr::null_mut(), Some("CLI".into()));
|
||||||
|
|
||||||
unsafe { dc_cmdline_skip_auth() };
|
|
||||||
|
|
||||||
if args.len() == 2 {
|
if args.len() == 2 {
|
||||||
if unsafe { !dc_open(&mut context, &args[1], None) } {
|
if unsafe { !dc_open(&mut context, &args[1], None) } {
|
||||||
println!("Error: Cannot open {}.", args[0],);
|
println!("Error: Cannot open {}.", args[0],);
|
||||||
|
|||||||
Reference in New Issue
Block a user