disable_sync, new leave_device_group sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 09 Dec 2019 11:56:22 +0100
branchsync
changeset 424337161269898d
parent 4241 aacb9a670617
child 4244 8d4faa88ddcf
disable_sync, new leave_device_group
src/sync_api.c
src/sync_api.h
sync/cond_act_sync.yml2
     1.1 --- a/src/sync_api.c	Mon Dec 09 10:58:01 2019 +0100
     1.2 +++ b/src/sync_api.c	Mon Dec 09 11:56:22 2019 +0100
     1.3 @@ -224,7 +224,7 @@
     1.4      return status;
     1.5  }
     1.6  
     1.7 -DYNAMIC_API PEP_STATUS leave_device_group(PEP_SESSION session)
     1.8 +PEP_STATUS disable_sync(PEP_SESSION session)
     1.9  {
    1.10      assert(session);
    1.11      if (!session)
    1.12 @@ -249,6 +249,14 @@
    1.13      return status;
    1.14  }
    1.15  
    1.16 +DYNAMIC_API PEP_STATUS leave_device_group(PEP_SESSION session) {
    1.17 +    assert(session);
    1.18 +    if (!session)
    1.19 +        return PEP_ILLEGAL_VALUE;
    1.20 +        
    1.21 +    return signal_Sync_event(session, Sync_PR_keysync, GroupKeyResetRequiredAndDisable, NULL);
    1.22 +}
    1.23 +
    1.24  DYNAMIC_API PEP_STATUS enable_identity_for_sync(PEP_SESSION session,
    1.25          pEp_identity *ident)
    1.26  {
    1.27 @@ -294,4 +302,3 @@
    1.28      status = set_identity_flags(session, ident, PEP_idf_not_for_sync);
    1.29      return status;
    1.30  }
    1.31 -
     2.1 --- a/src/sync_api.h	Mon Dec 09 10:58:01 2019 +0100
     2.2 +++ b/src/sync_api.h	Mon Dec 09 11:56:22 2019 +0100
     2.3 @@ -201,14 +201,21 @@
     2.4      );
     2.5  
     2.6  
     2.7 -// leave_device_group() - leave a device group and shutdown sync
     2.8 +// disable_sync() - leave a device group and shutdown sync
     2.9 +//
    2.10 +//  parameters:
    2.11 +//      session                 pEp session
    2.12 +
    2.13 +PEP_STATUS disable_sync(PEP_SESSION session);
    2.14 +
    2.15 +// leave_device_group() - Issue a group key reset request and 
    2.16 +// leave the device group, shutting down sync \
    2.17  //
    2.18  //  parameters:
    2.19  //      session                 pEp session
    2.20  
    2.21  DYNAMIC_API PEP_STATUS leave_device_group(PEP_SESSION session);
    2.22  
    2.23 -
    2.24  // enable_identity_for_sync() - enable sync for this identity
    2.25  //  parameters:
    2.26  //      session                 pEp session
    2.27 @@ -230,4 +237,3 @@
    2.28  #ifdef __cplusplus
    2.29  }
    2.30  #endif
    2.31 -
     3.1 --- a/sync/cond_act_sync.yml2	Mon Dec 09 10:58:01 2019 +0100
     3.2 +++ b/sync/cond_act_sync.yml2	Mon Dec 09 11:56:22 2019 +0100
     3.3 @@ -574,8 +574,7 @@
     3.4  
     3.5  action disable
     3.6  ||
     3.7 -    leave_device_group(session);
     3.8 +    disable_sync(session);
     3.9  ||
    3.10  
    3.11  action ResetGroupKeys;
    3.12 -