Identity type in messages sync
authorVolker Birk <vb@pep-project.org>
Fri, 19 Jul 2019 16:19:37 +0200
branchsync
changeset 3935578eeb202e26
parent 3932 c487731d164d
child 3936 a4837da81310
Identity type in messages
sync/gen_message_func.ysl2
     1.1 --- a/sync/gen_message_func.ysl2	Tue Jul 16 14:59:27 2019 +0200
     1.2 +++ b/sync/gen_message_func.ysl2	Fri Jul 19 16:19:37 2019 +0200
     1.3 @@ -297,6 +297,20 @@
     1.4                   = session->«$state».«@name»;
     1.5  
     1.6          ||
     1.7 +        when "@type='Identity'"
     1.8 +        ||
     1.9 +        {
    1.10 +            pEp_identity *ident = Identity_to_Struct(&session->«$state».«@name», NULL);
    1.11 +            if (!ident)
    1.12 +                return PEP_OUT_OF_MEMORY;
    1.13 +            Identity_t *_ident = Identity_from_Struct(ident,
    1.14 +                    &msg->choice.«yml:lcase(../../@name)».choice.«$message_name».«@name»);
    1.15 +            free_identity(ident);
    1.16 +            if (!_ident)
    1.17 +                return PEP_OUT_OF_MEMORY;
    1.18 +        }
    1.19 +
    1.20 +        ||
    1.21          when "@type='IdentityList'"
    1.22          ||
    1.23          {
    1.24 @@ -362,6 +376,21 @@
    1.25                  .choice.«$message_name».«@name»;
    1.26  
    1.27          ||
    1.28 +        when "@type='Identity'"
    1.29 +        ||
    1.30 +        {
    1.31 +            pEp_identity *ident = Identity_to_Struct(
    1.32 +                    &msg->choice.«yml:lcase(../../@name)».choice.«$message_name».«@name», NULL);
    1.33 +            if (!ident)
    1.34 +                return PEP_OUT_OF_MEMORY;
    1.35 +            Identity_t *_ident = Identity_from_Struct(ident,
    1.36 +                    &session->«yml:lcase(../../../@name)»_state.«yml:lcase(../../@name)».«@name»);
    1.37 +            free_identity(ident);
    1.38 +            if (!_ident)
    1.39 +                return PEP_OUT_OF_MEMORY;
    1.40 +        }
    1.41 +
    1.42 +        ||
    1.43          when "@type='IdentityList'"
    1.44          ||
    1.45          {