src/keymanagement.c
changeset 2504 99b930afc2a0
parent 2501 2e8bb7f39f04
child 2506 876532219d20
     1.1 --- a/src/keymanagement.c	Tue Feb 13 16:08:48 2018 +0100
     1.2 +++ b/src/keymanagement.c	Wed Feb 14 16:02:08 2018 +0100
     1.3 @@ -975,6 +975,8 @@
     1.4      }
     1.5      
     1.6      status = set_identity(session, identity);
     1.7 +    if (status == PEP_STATUS_OK)
     1.8 +        status = set_as_pep_user(session, identity);
     1.9  
    1.10  pep_free:    
    1.11      free(default_own_id);
    1.12 @@ -1144,7 +1146,12 @@
    1.13      else {
    1.14          status = delete_mistrusted_key(session, cached_ident->fpr);
    1.15          if (status == PEP_STATUS_OK) {
    1.16 -            status = set_identity(session, cached_ident);            
    1.17 +            status = set_identity(session, cached_ident);
    1.18 +            // THIS SHOULDN'T BE NECESSARY - PREVIOUS VALUE WAS IN THE DB
    1.19 +            // if (status == PEP_STATUS_OK) {
    1.20 +            //     if ((cached_ident->comm_type | PEP_ct_confirmed) == PEP_ct_pEp)
    1.21 +            //         status = set_as_pep_user(session, cached_ident);
    1.22 +            // }            
    1.23              free_identity(session->cached_mistrusted);
    1.24          }
    1.25      }
    1.26 @@ -1326,7 +1333,11 @@
    1.27                      free(ident_copy->fpr);
    1.28                      ident_copy->fpr = strdup(cached_fpr);
    1.29                      ident_copy->comm_type = tmp_id->comm_type;
    1.30 -                    status = set_identity(session, ident_copy); // replace identity default            
    1.31 +                    status = set_identity(session, ident_copy); // replace identity default
    1.32 +                    if (status == PEP_STATUS_OK) {
    1.33 +                        if ((ident_copy->comm_type | PEP_ct_confirmed) == PEP_ct_pEp)
    1.34 +                            status = set_as_pep_user(session, ident_copy);
    1.35 +                    }            
    1.36                  }
    1.37              }
    1.38              else { // we're setting this on the default fpr