@@ -317,7 +317,7 @@ blinded_contact_info::blinded_contact_info(
317
317
}
318
318
319
319
void 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" );
321
321
322
322
auto url = maybe_string (info_dict, " p" );
323
323
auto key = maybe_vector (info_dict, " q" );
@@ -327,8 +327,8 @@ void blinded_contact_info::load(const dict& info_dict) {
327
327
} else {
328
328
profile_picture.clear ();
329
329
}
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" );
332
332
}
333
333
334
334
void blinded_contact_info::into (contacts_blinded_contact& c) const {
@@ -346,7 +346,7 @@ void blinded_contact_info::into(contacts_blinded_contact& c) const {
346
346
copy_c_str (c.profile_pic .url , " " );
347
347
}
348
348
c.legacy_blinding = legacy_blinding;
349
- c.created = to_epoch_seconds ( created);
349
+ c.created = created. time_since_epoch (). count ( );
350
350
}
351
351
352
352
blinded_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) {
359
359
profile_picture.key .assign (c.profile_pic .key , c.profile_pic .key + 32 );
360
360
}
361
361
legacy_blinding = c.legacy_blinding ;
362
- created = to_epoch_seconds (c.created );
362
+ created = to_sys_seconds (c.created );
363
363
}
364
364
365
365
const std::string blinded_contact_info::session_id () const {
@@ -472,7 +472,7 @@ void Contacts::set_blinded(const blinded_contact_info& bc) {
472
472
bc.profile_picture .key );
473
473
474
474
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 );
476
476
}
477
477
478
478
bool Contacts::erase_blinded (
@@ -717,4 +717,4 @@ LIBSESSION_C_API void contacts_iterator_advance(contacts_iterator* it) {
717
717
++*static_cast <Contacts::iterator*>(it->_internals );
718
718
}
719
719
720
- } // extern "C"
720
+ } // extern "C"
0 commit comments