@@ -97,7 +97,7 @@ void contact_info::load(const dict& info_dict) {
9797 } else {
9898 notifications = notify_mode::defaulted;
9999 }
100- mute_until = to_seconds (maybe_int (info_dict, " !" ).value_or (0 ));
100+ mute_until = to_epoch_seconds (maybe_int (info_dict, " !" ).value_or (0 ));
101101
102102 int exp_mode_ = maybe_int (info_dict, " e" ).value_or (0 );
103103 if (exp_mode_ >= static_cast <int >(expiration_mode::none) &&
@@ -118,7 +118,7 @@ void contact_info::load(const dict& info_dict) {
118118 }
119119 }
120120
121- created = to_seconds (maybe_int (info_dict, " j" ).value_or (0 ));
121+ created = to_epoch_seconds (maybe_int (info_dict, " j" ).value_or (0 ));
122122}
123123
124124void contact_info::into (contacts_contact& c) const {
@@ -136,12 +136,12 @@ void contact_info::into(contacts_contact& c) const {
136136 c.blocked = blocked;
137137 c.priority = priority;
138138 c.notifications = static_cast <CONVO_NOTIFY_MODE>(notifications);
139- c.mute_until = to_seconds (mute_until);
139+ c.mute_until = to_epoch_seconds (mute_until);
140140 c.exp_mode = static_cast <CONVO_EXPIRATION_MODE>(exp_mode);
141141 c.exp_seconds = exp_timer.count ();
142142 if (c.exp_seconds <= 0 && c.exp_mode != CONVO_EXPIRATION_NONE)
143143 c.exp_mode = CONVO_EXPIRATION_NONE;
144- c.created = to_seconds (created);
144+ c.created = to_epoch_seconds (created);
145145}
146146
147147contact_info::contact_info (const contacts_contact& c) : session_id{c.session_id , 66 } {
@@ -159,12 +159,12 @@ contact_info::contact_info(const contacts_contact& c) : session_id{c.session_id,
159159 blocked = c.blocked ;
160160 priority = c.priority ;
161161 notifications = static_cast <notify_mode>(c.notifications );
162- mute_until = to_seconds (c.mute_until );
162+ mute_until = to_epoch_seconds (c.mute_until );
163163 exp_mode = static_cast <expiration_mode>(c.exp_mode );
164164 exp_timer = exp_mode == expiration_mode::none ? 0s : std::chrono::seconds{c.exp_seconds };
165165 if (exp_timer <= 0s && exp_mode != expiration_mode::none)
166166 exp_mode = expiration_mode::none;
167- created = to_seconds (c.created );
167+ created = to_epoch_seconds (c.created );
168168}
169169
170170std::optional<contact_info> Contacts::get (std::string_view pubkey_hex) const {
@@ -240,7 +240,7 @@ void Contacts::set(const contact_info& contact) {
240240 if (notify == notify_mode::mentions_only)
241241 notify = notify_mode::all;
242242 set_positive_int (info[" @" ], static_cast <int >(notify));
243- set_positive_int (info[" !" ], to_seconds (contact.mute_until ));
243+ set_positive_int (info[" !" ], to_epoch_seconds (contact.mute_until ));
244244
245245 set_pair_if (
246246 contact.exp_mode != expiration_mode::none && contact.exp_timer > 0s,
@@ -249,7 +249,7 @@ void Contacts::set(const contact_info& contact) {
249249 info[" E" ],
250250 contact.exp_timer .count ());
251251
252- set_positive_int (info[" j" ], to_seconds (contact.created ));
252+ set_positive_int (info[" j" ], to_epoch_seconds (contact.created ));
253253}
254254
255255LIBSESSION_C_API void contacts_set (config_object* conf, const contacts_contact* contact) {
@@ -314,7 +314,7 @@ void Contacts::set_expiry(
314314
315315void Contacts::set_created (std::string_view session_id, int64_t timestamp) {
316316 auto c = get_or_construct (session_id);
317- c.created = to_seconds (timestamp);
317+ c.created = to_epoch_seconds (timestamp);
318318 set (c);
319319}
320320
0 commit comments