update_identity(): if no user_id then have a look if it is an own identity first, and if so call myself() keysync
authorVolker Birk <vb@pep.foundation>
Mon, 15 Aug 2016 17:45:17 +0200
branchkeysync
changeset 10153a533d848620
parent 1009 3faf72e9e7ab
child 1016 3c97711fc15a
update_identity(): if no user_id then have a look if it is an own identity first, and if so call myself()
src/keymanagement.c
     1.1 --- a/src/keymanagement.c	Fri Aug 12 18:13:56 2016 +0200
     1.2 +++ b/src/keymanagement.c	Mon Aug 15 17:45:17 2016 +0200
     1.3 @@ -124,6 +124,13 @@
     1.4  
     1.5      if (_no_user_id)
     1.6      {
     1.7 +        status = get_identity(session, identity->address, PEP_OWN_USERID,
     1.8 +                &stored_identity);
     1.9 +        if (status == PEP_STATUS_OK) {
    1.10 +            free_identity(stored_identity);
    1.11 +            return myself(session, identity);
    1.12 +        }
    1.13 +
    1.14          free(identity->user_id);
    1.15  
    1.16          identity->user_id = calloc(1, strlen(identity->address) + 6);