mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
Turn dc_ensure_secret_key_existy into something more rusty
This marks the function safe and returns Result, it also now returns the ConfiguredAddr since it has to look this up anyway and it makes testing more easy. Turns out it reduces some duplicate SQL query in some callers too. More test code has been moved from dc_imex to test_utils as it's more genrally applicable.
This commit is contained in:
committed by
Floris Bruynooghe
parent
ff39fa0fed
commit
f31f603c8b
@@ -1091,7 +1091,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
||||
|
||||
let mut res = format!("Contact info for: {}:\n\n", name_n_addr);
|
||||
|
||||
res += &Contact::get_encrinfo(context, contact_id);
|
||||
res += &Contact::get_encrinfo(context, contact_id)?;
|
||||
|
||||
let chatlist = Chatlist::try_load(context, 0, None, Some(contact_id))?;
|
||||
let chatlist_cnt = chatlist.len();
|
||||
|
||||
Reference in New Issue
Block a user