... keysync
authorVolker Birk <vb@pep.foundation>
Wed, 24 Aug 2016 08:09:57 +0200
branchkeysync
changeset 10785861b53e0536
parent 1077 d22b9d70370d
child 1079 5253962c6bf7
...
src/keymanagement.c
src/sync.c
     1.1 --- a/src/keymanagement.c	Wed Aug 24 00:30:50 2016 +0200
     1.2 +++ b/src/keymanagement.c	Wed Aug 24 08:09:57 2016 +0200
     1.3 @@ -120,6 +120,11 @@
     1.4      if (!(session && identity && !EMPTYSTR(identity->address)))
     1.5          return PEP_ILLEGAL_VALUE;
     1.6  
     1.7 +    if (identity->me || (identity->user_id && strcmp(identity->user_id, PEP_OWN_USERID) == 0)) {
     1.8 +        identity->me = true;
     1.9 +        return myself(session, identity);
    1.10 +    }
    1.11 +
    1.12      int _no_user_id = EMPTYSTR(identity->user_id);
    1.13  
    1.14      if (_no_user_id)
    1.15 @@ -746,11 +751,12 @@
    1.16                  flags = (unsigned int)
    1.17                      sqlite3_column_int(session->own_key_is_listed, 4);
    1.18  
    1.19 -                pEp_identity *ident = new_identity(address, fpr, username, user_id);
    1.20 +                pEp_identity *ident = new_identity(address, fpr, user_id, username);
    1.21                  ident->comm_type = comm_type;
    1.22                  if (lang && lang[0]) {
    1.23                      ident->lang[0] = lang[0];
    1.24                      ident->lang[1] = lang[1];
    1.25 +                    ident->lang[2] = 0;
    1.26                  }
    1.27                  ident->me = true;
    1.28                  ident->flags = flags;
     2.1 --- a/src/sync.c	Wed Aug 24 00:30:50 2016 +0200
     2.2 +++ b/src/sync.c	Wed Aug 24 08:09:57 2016 +0200
     2.3 @@ -80,7 +80,7 @@
     2.4          void *management
     2.5      )
     2.6  {
     2.7 -    DeviceGroup_Protocol_t *msg;
     2.8 +    DeviceGroup_Protocol_t *msg = NULL;
     2.9      PEP_STATUS status = PEP_STATUS_OK;
    2.10  
    2.11      assert(session && session->retrieve_next_sync_msg);