src/message_api.c
branchENGINE-559
changeset 3880 1642cd731c9f
parent 3829 e1d53d19bb4d
parent 3879 e8bf8bb51582
child 3915 c3fa76972af5
     1.1 --- a/src/message_api.c	Mon Jun 17 15:31:28 2019 +0200
     1.2 +++ b/src/message_api.c	Wed Jun 26 11:36:48 2019 +0200
     1.3 @@ -3144,6 +3144,20 @@
     1.4      return status;    
     1.5  }
     1.6  
     1.7 +static PEP_STATUS reconcile_sent_and_recv_info(message* src, message* inner_message) {
     1.8 +    PEP_STATUS status = PEP_STATUS_OK;
     1.9 +    if (!src || !inner_message)
    1.10 +        return PEP_ILLEGAL_VALUE;
    1.11 +        
    1.12 +    if (!inner_message->sent)
    1.13 +        inner_message->sent = timestamp_dup(src->sent);
    1.14 +        
    1.15 +    // This will never be set otherwise, since it's a transport header on the outside    
    1.16 +    inner_message->recv = timestamp_dup(src->recv);
    1.17 +    
    1.18 +    return PEP_STATUS_OK;
    1.19 +}
    1.20 +
    1.21  static PEP_STATUS reconcile_src_and_inner_messages(message* src, 
    1.22                                               message* inner_message) {
    1.23  
    1.24 @@ -3161,6 +3175,9 @@
    1.25      if (status == PEP_STATUS_OK && inner_message->bcc)
    1.26          status = reconcile_identity_lists(src->bcc, inner_message->bcc);
    1.27  
    1.28 +    if (status == PEP_STATUS_OK)
    1.29 +        status = reconcile_sent_and_recv_info(src, inner_message);
    1.30 +        
    1.31      return status;
    1.32      // FIXME - are there any flags or anything else we need to be sure are carried?
    1.33  }