Add autoconsume to outside of key reset messages; also, fixed sync fsm for group leaver. Should not depend on msg receipt. sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 27 Jan 2020 15:16:49 +0100
branchsync
changeset 43635cf6a03ac9be
parent 4362 9d62b5b79f73
child 4365 cccf17941b9d
Add autoconsume to outside of key reset messages; also, fixed sync fsm for group leaver. Should not depend on msg receipt.
src/key_reset.c
sync/sync.fsm
     1.1 --- a/src/key_reset.c	Mon Jan 27 11:34:36 2020 +0100
     1.2 +++ b/src/key_reset.c	Mon Jan 27 15:16:49 2020 +0100
     1.3 @@ -20,6 +20,11 @@
     1.4  #define KEY_RESET_MAJOR_VERSION 1L
     1.5  #define KEY_RESET_MINOR_VERSION 0L
     1.6  
     1.7 +static void _add_auto_consume(message* msg) {
     1.8 +    add_opt_field(msg, "pEp-auto-consume", "yes");
     1.9 +    msg->in_reply_to = stringlist_add(msg->in_reply_to, "pEp-auto-consume@pEp.foundation");
    1.10 +}
    1.11 +
    1.12  static PEP_STATUS _generate_reset_structs(PEP_SESSION session,
    1.13                                            const pEp_identity* reset_ident,
    1.14                                            const char* old_fpr,
    1.15 @@ -793,7 +798,8 @@
    1.16              free(reset_msg);
    1.17              goto pEp_free;
    1.18          }
    1.19 -        
    1.20 +
    1.21 +        _add_auto_consume(reset_msg);        
    1.22          // insert into queue
    1.23          status = send_cb(reset_msg);
    1.24  
    1.25 @@ -943,7 +949,8 @@
    1.26          if (status != PEP_STATUS_OK) {
    1.27              goto pEp_free;
    1.28          }
    1.29 -
    1.30 +        _add_auto_consume(enc_msg);
    1.31 +        
    1.32          // insert into queue
    1.33          status = send_cb(enc_msg);
    1.34  
     2.1 --- a/sync/sync.fsm	Mon Jan 27 11:34:36 2020 +0100
     2.2 +++ b/sync/sync.fsm	Mon Jan 27 15:16:49 2020 +0100
     2.3 @@ -360,7 +360,8 @@
     2.4              // this is for a leaving group member
     2.5              on GroupKeyResetRequiredAndDisable {
     2.6                  send InitUnledGroupKeyReset;
     2.7 -                go DisableOnInitUnledGroupKeyReset;
     2.8 +                do disable;
     2.9 +                do resetOwnKeysUngrouped;
    2.10              }
    2.11  
    2.12              on InitUnledGroupKeyReset {
    2.13 @@ -385,13 +386,6 @@
    2.14              }
    2.15          }
    2.16  
    2.17 -        state DisableOnInitUnledGroupKeyReset {
    2.18 -            on InitUnledGroupKeyReset {
    2.19 -                do disable;
    2.20 -                do resetOwnKeysUngrouped;
    2.21 -            }    
    2.22 -        }
    2.23 -
    2.24          // sole device handshaking with group
    2.25          state HandshakingToJoin {
    2.26              on Init