src/transport.c
changeset 89 aef5a4bc78f3
parent 81 044ce1c7fc9c
child 94 9ec29aa10b58
     1.1 --- a/src/transport.c	Wed Mar 04 13:32:07 2015 +0100
     1.2 +++ b/src/transport.c	Sat Mar 07 20:29:13 2015 +0100
     1.3 @@ -229,13 +229,18 @@
     1.4          free(msg->longmsg);
     1.5          free(msg->longmsg_formatted);
     1.6          free_bloblist(msg->attachments);
     1.7 +        free(msg->sent);
     1.8 +        free(msg->recv);
     1.9          free_identity(msg->from);
    1.10          free_identity_list(msg->to);
    1.11          free_identity(msg->recv_by);
    1.12          free_identity_list(msg->cc);
    1.13          free_identity_list(msg->bcc);
    1.14          free_identity(msg->reply_to);
    1.15 -        free(msg->refering_id);
    1.16 +        free(msg->in_reply_to);
    1.17 +        free_stringlist(msg->references);
    1.18 +        free_stringlist(msg->keywords);
    1.19 +        free(msg->comments);
    1.20          free(msg);
    1.21      }
    1.22  }
    1.23 @@ -289,8 +294,20 @@
    1.24  
    1.25      msg->rawmsg_ref = src->rawmsg_ref;
    1.26      msg->rawmsg_size = src->rawmsg_size;
    1.27 -    msg->sent = src->sent;
    1.28 -    msg->recv = src->recv;
    1.29 +
    1.30 +    if (src->sent) {
    1.31 +        msg->sent = malloc(sizeof(timestamp));
    1.32 +        if (msg->sent == NULL)
    1.33 +            goto enomem;
    1.34 +        memcpy(msg->sent, src->sent, sizeof(timestamp));
    1.35 +    }
    1.36 +
    1.37 +    if (src->recv) {
    1.38 +        msg->recv = malloc(sizeof(timestamp));
    1.39 +        if (msg->recv == NULL)
    1.40 +            goto enomem;
    1.41 +        memcpy(msg->recv, src->recv, sizeof(timestamp));
    1.42 +    }
    1.43  
    1.44      if (src->recv_by) {
    1.45          msg->recv_by = identity_dup(src->recv_by);
    1.46 @@ -316,21 +333,40 @@
    1.47              goto enomem;
    1.48      }
    1.49  
    1.50 -    if (src->refering_id) {
    1.51 -        msg->refering_id = strdup(src->refering_id);
    1.52 -        assert(msg->refering_id);
    1.53 -        if (msg->refering_id == NULL)
    1.54 +    if (src->in_reply_to) {
    1.55 +        msg->in_reply_to = strdup(src->in_reply_to);
    1.56 +        assert(msg->in_reply_to);
    1.57 +        if (msg->in_reply_to == NULL)
    1.58              goto enomem;
    1.59      }
    1.60  
    1.61      msg->refering_msg_ref = src->refering_msg_ref;
    1.62      
    1.63 +    if (src->references) {
    1.64 +        msg->references = stringlist_dup(src->references);
    1.65 +        if (msg->references == NULL)
    1.66 +            goto enomem;
    1.67 +    }
    1.68 +
    1.69      if (src->refered_by) {
    1.70          msg->refered_by = message_ref_list_dup(src->refered_by);
    1.71          if (msg->refered_by == NULL)
    1.72              goto enomem;
    1.73      }
    1.74  
    1.75 +    if (src->keywords) {
    1.76 +        msg->keywords = stringlist_dup(src->keywords);
    1.77 +        if (msg->keywords == NULL)
    1.78 +            goto enomem;
    1.79 +    }
    1.80 +
    1.81 +    if (src->comments) {
    1.82 +        msg->comments = strdup(src->comments);
    1.83 +        assert(msg->comments);
    1.84 +        if (msg->comments == NULL)
    1.85 +            goto enomem;
    1.86 +    }
    1.87 +
    1.88      msg->enc_format = src->enc_format;
    1.89  
    1.90      return msg;