diff --git a/bin/domain/imag-contact/Cargo.toml b/bin/domain/imag-contact/Cargo.toml index 71a4b1c9..b44fc224 100644 --- a/bin/domain/imag-contact/Cargo.toml +++ b/bin/domain/imag-contact/Cargo.toml @@ -28,7 +28,7 @@ toml-query = "0.6" handlebars = "0.29" vobject = "0.4" walkdir = "1" -uuid = { version = "0.5", features = ["v4"] } +uuid = { version = "0.6", features = ["v4"] } libimagrt = { version = "0.7.0", path = "../../../lib/core/libimagrt" } libimagstore = { version = "0.7.0", path = "../../../lib/core/libimagstore" } diff --git a/bin/domain/imag-contact/src/create.rs b/bin/domain/imag-contact/src/create.rs index 51278c28..9b44b703 100644 --- a/bin/domain/imag-contact/src/create.rs +++ b/bin/domain/imag-contact/src/create.rs @@ -31,13 +31,13 @@ use toml::Value; use uuid::Uuid; use libimagcontact::error::ContactError as CE; +use libimagcontact::store::UniqueContactPathGenerator; use libimagrt::runtime::Runtime; use libimagerror::str::ErrFromStr; use libimagerror::trace::MapErrTrace; use libimagerror::trace::trace_error; use libimagutil::warn_result::WarnResult; use libimagentryref::refstore::RefStore; -use libimagentryref::flags::RefFlags; const TEMPLATE : &'static str = include_str!("../static/new-contact-template.toml"); @@ -144,11 +144,7 @@ pub fn create(rt: &Runtime) { if let Some(location) = location { if !scmd.is_present("dont-track") { - let flags = RefFlags::default() - .with_content_hashing(true) - .with_permission_tracking(false); - - RefStore::create(rt.store(), location, flags) + RefStore::create_ref::(rt.store(), location) .map_err_trace_exit_unwrap(1); info!("Created entry in store"); diff --git a/bin/domain/imag-contact/src/main.rs b/bin/domain/imag-contact/src/main.rs index c2785901..35ad1e0b 100644 --- a/bin/domain/imag-contact/src/main.rs +++ b/bin/domain/imag-contact/src/main.rs @@ -67,6 +67,7 @@ use libimagerror::trace::MapErrTrace; use libimagerror::io::ToExitCode; use libimagerror::exit::ExitUnwrap; use libimagcontact::store::ContactStore; +use libimagcontact::store::UniqueContactPathGenerator; use libimagcontact::error::ContactError as CE; use libimagcontact::contact::Contact; use libimagstore::iter::get::StoreIdGetIteratorExtension; @@ -130,7 +131,7 @@ fn list(rt: &Runtime) { }) .enumerate() .map(|(i, (fle, vcard))| { - let hash = fle.get_path_hash().map_err_trace_exit_unwrap(1); + let hash = String::from(fle.get_hash().map_err_trace_exit_unwrap(1)); let vcard = vcard.unwrap_or_else(|e| { error!("Element is not a VCARD object: {:?}", e); exit(1) @@ -190,7 +191,7 @@ fn show(rt: &Runtime) { let hash = scmd.value_of("hash").map(String::from).unwrap(); // safed by clap let contact_data = rt.store() - .get_by_hash(hash.clone()) + .get_ref::(hash.clone()) .map_err_trace_exit_unwrap(1) .ok_or(CE::from(format!("No entry for hash {}", hash))) .map_err_trace_exit_unwrap(1)