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 22  "main" : " index.js" 
33  "name" : " libsession_util_nodejs" 
44  "description" : " Wrappers for the Session Util Library" 
5-   "version" : " 0.5.7 " 
5+   "version" : " 0.5.8 " 
66  "license" : " GPL-3.0" 
77  "author" : {
88    "name" : " Oxen Project" 
Original file line number Diff line number Diff line change @@ -145,7 +145,8 @@ void ContactsConfigWrapper::set(const Napi::CallbackInfo& info) {
145145
146146        //  if the saved profile info is older than the new one, update it and the profile fields
147147        //  provided
148-         if  (contact.profile_updated  < newProfileUpdateSeconds) {
148+         if  (contact.profile_updated .time_since_epoch ().count () == 0  ||
149+             contact.profile_updated  < newProfileUpdateSeconds) {
149150            contact.profile_updated  = newProfileUpdateSeconds;
150151
151152            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) {
649649        auto  updatedAtSeconds =
650650                toCppSysSeconds (argsAsObj.Get (" profileUpdatedSeconds" " memberSetProfileDetails" 
651651
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 )) {
654657            m->profile_updated  = updatedAtSeconds;
655658
656659            auto  profilePicture = profile_pic_from_object (argsAsObj.Get (" profilePicture" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments