File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 2
2
"main" : " index.js" ,
3
3
"name" : " libsession_util_nodejs" ,
4
4
"description" : " Wrappers for the Session Util Library" ,
5
- "version" : " 0.5.7 " ,
5
+ "version" : " 0.5.8 " ,
6
6
"license" : " GPL-3.0" ,
7
7
"author" : {
8
8
"name" : " Oxen Project" ,
Original file line number Diff line number Diff line change @@ -145,7 +145,8 @@ void ContactsConfigWrapper::set(const Napi::CallbackInfo& info) {
145
145
146
146
// if the saved profile info is older than the new one, update it and the profile fields
147
147
// provided
148
- if (contact.profile_updated < newProfileUpdateSeconds) {
148
+ if (contact.profile_updated .time_since_epoch ().count () == 0 ||
149
+ contact.profile_updated < newProfileUpdateSeconds) {
149
150
contact.profile_updated = newProfileUpdateSeconds;
150
151
151
152
if (auto name = maybeNonemptyString (obj.Get (" name" ), " contacts.set name" ))
Original file line number Diff line number Diff line change @@ -649,8 +649,11 @@ void MetaGroupWrapper::memberSetProfileDetails(const Napi::CallbackInfo& info) {
649
649
auto updatedAtSeconds =
650
650
toCppSysSeconds (argsAsObj.Get (" profileUpdatedSeconds" ), " memberSetProfileDetails" );
651
651
652
- // if the profile details provided are more recent that the ones saved, update them
653
- if (m && updatedAtSeconds > m->profile_updated ) {
652
+ // if the profile details provided are more recent that the ones saved, update them.
653
+ // we also allow anything when our current value is 0, as it means we haven't got an updated
654
+ // profileDetails yet
655
+ if (m && (updatedAtSeconds > m->profile_updated ||
656
+ m->profile_updated .time_since_epoch ().count () == 0 )) {
654
657
m->profile_updated = updatedAtSeconds;
655
658
656
659
auto profilePicture = profile_pic_from_object (argsAsObj.Get (" profilePicture" ));
You can’t perform that action at this time.
0 commit comments