@@ -317,7 +317,7 @@ blinded_contact_info::blinded_contact_info(
317317}
318318
319319void blinded_contact_info::load (const dict& info_dict) {
320- name = maybe_string (info_dict, " n" ). value_or ( " " );
320+ name = string_or_empty (info_dict, " n" );
321321
322322 auto url = maybe_string (info_dict, " p" );
323323 auto key = maybe_vector (info_dict, " q" );
@@ -327,8 +327,8 @@ void blinded_contact_info::load(const dict& info_dict) {
327327 } else {
328328 profile_picture.clear ();
329329 }
330- legacy_blinding = maybe_int (info_dict, " y" ). value_or ( 0 );
331- created = to_epoch_seconds ( maybe_int ( info_dict, " j" ). value_or ( 0 ) );
330+ legacy_blinding = int_or_0 (info_dict, " y" );
331+ created = ts_or_epoch ( info_dict, " j" );
332332}
333333
334334void blinded_contact_info::into (contacts_blinded_contact& c) const {
@@ -346,7 +346,7 @@ void blinded_contact_info::into(contacts_blinded_contact& c) const {
346346 copy_c_str (c.profile_pic .url , " " );
347347 }
348348 c.legacy_blinding = legacy_blinding;
349- c.created = to_epoch_seconds ( created);
349+ c.created = created. time_since_epoch (). count ( );
350350}
351351
352352blinded_contact_info::blinded_contact_info (const contacts_blinded_contact& c) {
@@ -359,7 +359,7 @@ blinded_contact_info::blinded_contact_info(const contacts_blinded_contact& c) {
359359 profile_picture.key .assign (c.profile_pic .key , c.profile_pic .key + 32 );
360360 }
361361 legacy_blinding = c.legacy_blinding ;
362- created = to_epoch_seconds (c.created );
362+ created = to_sys_seconds (c.created );
363363}
364364
365365const std::string blinded_contact_info::session_id () const {
@@ -472,7 +472,7 @@ void Contacts::set_blinded(const blinded_contact_info& bc) {
472472 bc.profile_picture .key );
473473
474474 set_positive_int (info[" y" ], bc.legacy_blinding );
475- set_positive_int (info[" j" ], to_epoch_seconds ( bc.created ) );
475+ set_ts (info[" j" ], bc.created );
476476}
477477
478478bool Contacts::erase_blinded (
@@ -717,4 +717,4 @@ LIBSESSION_C_API void contacts_iterator_advance(contacts_iterator* it) {
717717 ++*static_cast <Contacts::iterator*>(it->_internals );
718718}
719719
720- } // extern "C"
720+ } // extern "C"
0 commit comments