Better english for KeySync messages status flags ENGINE-140
authorEdouard Tisserant <edouard@pep-project.org>
Thu, 10 Nov 2016 21:01:08 +0100
branchENGINE-140
changeset 13699df1ba0ecf18
parent 1368 67a5dc1a97f8
child 1370 274b7141afb6
child 1404 a167658d3fdd
Better english for KeySync messages status flags
src/message_api.c
src/message_api.h
src/pEpEngine.h
src/sync_impl.c
     1.1 --- a/src/message_api.c	Thu Nov 10 18:06:09 2016 +0100
     1.2 +++ b/src/message_api.c	Thu Nov 10 21:01:08 2016 +0100
     1.3 @@ -1410,13 +1410,13 @@
     1.4                  remove_attached_keys(src);
     1.5              if(session->inject_sync_msg){
     1.6                  status = receive_DeviceState_msg(session, src, *rating, *keylist);
     1.7 -                if (status == PEP_MESSAGE_CONSUMED || 
     1.8 -                    status == PEP_MESSAGE_DISCARDED) {
     1.9 +                if (status == PEP_MESSAGE_CONSUME || 
    1.10 +                    status == PEP_MESSAGE_IGNORE) {
    1.11                      free_message(msg);
    1.12                      msg = NULL;
    1.13 -                    *flags |= (status == PEP_MESSAGE_DISCARDED) ?
    1.14 -                                PEP_decrypt_flag_discarded :
    1.15 -                                PEP_decrypt_flag_consumed;
    1.16 +                    *flags |= (status == PEP_MESSAGE_IGNORE) ?
    1.17 +                                PEP_decrypt_flag_ignore :
    1.18 +                                PEP_decrypt_flag_consume;
    1.19                  }
    1.20                  else if (status != PEP_STATUS_OK) {
    1.21                      return status;
    1.22 @@ -1697,13 +1697,13 @@
    1.23              remove_attached_keys(msg);
    1.24          if (*rating >= PEP_rating_reliable && session->inject_sync_msg) {
    1.25              status = receive_DeviceState_msg(session, msg, *rating, _keylist);
    1.26 -            if (status == PEP_MESSAGE_CONSUMED || 
    1.27 -                status == PEP_MESSAGE_DISCARDED) {
    1.28 +            if (status == PEP_MESSAGE_CONSUME || 
    1.29 +                status == PEP_MESSAGE_IGNORE) {
    1.30                  free_message(msg);
    1.31                  msg = NULL;
    1.32 -                *flags |= (status == PEP_MESSAGE_DISCARDED) ?
    1.33 -                            PEP_decrypt_flag_discarded :
    1.34 -                            PEP_decrypt_flag_consumed;
    1.35 +                *flags |= (status == PEP_MESSAGE_IGNORE) ?
    1.36 +                            PEP_decrypt_flag_ignore :
    1.37 +                            PEP_decrypt_flag_consume;
    1.38  
    1.39                  status = decrypt_status;
    1.40              }
     2.1 --- a/src/message_api.h	Thu Nov 10 18:06:09 2016 +0100
     2.2 +++ b/src/message_api.h	Thu Nov 10 21:01:08 2016 +0100
     2.3 @@ -158,8 +158,8 @@
     2.4  
     2.5  typedef enum _PEP_decrypt_flags {
     2.6      PEP_decrypt_flag_own_private_key = 0x1,
     2.7 -    PEP_decrypt_flag_consumed = 0x2,
     2.8 -    PEP_decrypt_flag_discarded = 0x4
     2.9 +    PEP_decrypt_flag_consume = 0x2,
    2.10 +    PEP_decrypt_flag_ignore = 0x4
    2.11  } PEP_decrypt_flags; 
    2.12  
    2.13  typedef unsigned int PEP_decrypt_flags_t;
     3.1 --- a/src/pEpEngine.h	Thu Nov 10 18:06:09 2016 +0100
     3.2 +++ b/src/pEpEngine.h	Thu Nov 10 21:01:08 2016 +0100
     3.3 @@ -92,8 +92,8 @@
     3.4      PEP_STATEMACHINE_INHIBITED_EVENT                = 0x0986,
     3.5  
     3.6      PEP_COMMIT_FAILED                               = 0xff01,
     3.7 -    PEP_MESSAGE_CONSUMED                            = 0xff02,
     3.8 -    PEP_MESSAGE_DISCARDED                           = 0xff03,
     3.9 +    PEP_MESSAGE_CONSUME                            = 0xff02,
    3.10 +    PEP_MESSAGE_IGNORE                           = 0xff03,
    3.11  
    3.12      PEP_RECORD_NOT_FOUND                            = -6,
    3.13      PEP_CANNOT_CREATE_TEMP_FILE                     = -5,
     4.1 --- a/src/sync_impl.c	Thu Nov 10 18:06:09 2016 +0100
     4.2 +++ b/src/sync_impl.c	Thu Nov 10 21:01:08 2016 +0100
     4.3 @@ -424,7 +424,7 @@
     4.4      }
     4.5  
     4.6      if (force_keep_msg) {
     4.7 -        return PEP_MESSAGE_DISCARDED;
     4.8 +        return PEP_MESSAGE_IGNORE;
     4.9      }
    4.10  
    4.11      if (consume && !session->keep_sync_msg) {
    4.12 @@ -434,14 +434,14 @@
    4.13                      strcasecmp(spl->value->key, "pEp-auto-consume") == 0) {
    4.14                  if (spl->value->value &&
    4.15                          strcasecmp(spl->value->value, "yes") == 0)
    4.16 -                    return PEP_MESSAGE_CONSUMED;
    4.17 +                    return PEP_MESSAGE_CONSUME;
    4.18              }
    4.19          }
    4.20 -        return PEP_MESSAGE_DISCARDED;
    4.21 +        return PEP_MESSAGE_IGNORE;
    4.22      }
    4.23  
    4.24      if(discard)
    4.25 -        return PEP_MESSAGE_DISCARDED;
    4.26 +        return PEP_MESSAGE_IGNORE;
    4.27  
    4.28      if (!session->keep_sync_msg) {
    4.29          bloblist_t *last = NULL;