src/etpan_mime.c
branchpostrelease
changeset 4592 f0e7ec9616c5
parent 4591 fbaa9d61a265
child 4719 b4d7c37ac808
     1.1 --- a/src/etpan_mime.c	Fri Apr 24 18:37:29 2020 +0200
     1.2 +++ b/src/etpan_mime.c	Fri Apr 24 19:38:56 2020 +0200
     1.3 @@ -1006,7 +1006,7 @@
     1.4  
     1.5  static PEP_STATUS interpret_MIME(struct mailmime *mime,
     1.6                                   message *msg,
     1.7 -                                 bool* raise_msg_attachment);
     1.8 +                                 bool* has_possible_pEp_msg);
     1.9  
    1.10  // This function was rewritten to use in-memory buffers instead of
    1.11  // temporary files when the pgp/mime support was implemented for
    1.12 @@ -2602,7 +2602,7 @@
    1.13  static PEP_STATUS interpret_MIME(
    1.14          struct mailmime *mime,
    1.15          message *msg,
    1.16 -        bool* raise_msg_attachment
    1.17 +        bool* has_possible_pEp_msg
    1.18      )
    1.19  {
    1.20      PEP_STATUS status = PEP_STATUS_OK;
    1.21 @@ -2687,13 +2687,13 @@
    1.22                  return PEP_ILLEGAL_VALUE;
    1.23  
    1.24              clistiter *cur;
    1.25 -            // only add raise_msg_attachment on 2nd part!
    1.26 +            // only add has_possible_pEp_msg on 2nd part!
    1.27              int _att_count = 0;
    1.28              for (cur = clist_begin(partlist); cur; cur = clist_next(cur), _att_count++) {
    1.29                  struct mailmime *part= clist_content(cur);
    1.30                  if (part == NULL)
    1.31                      return PEP_ILLEGAL_VALUE;
    1.32 -                status = interpret_MIME(part, msg, _att_count == 1 ? raise_msg_attachment : NULL);
    1.33 +                status = interpret_MIME(part, msg, _att_count == 1 ? has_possible_pEp_msg : NULL);
    1.34                  if (status != PEP_STATUS_OK)
    1.35                      return status;
    1.36              }
    1.37 @@ -2730,7 +2730,7 @@
    1.38              }
    1.39              else {
    1.40                  // Fixme - we need a control on recursion level here - KG: maybe NOT. We only go to depth 1.
    1.41 -                if (raise_msg_attachment != NULL) {
    1.42 +                if (has_possible_pEp_msg != NULL) {
    1.43                      bool is_msg = (_is_message_part(content, "rfc822") || _is_text_part(content, "rfc822"));
    1.44                      if (is_msg) {
    1.45                          if (content->ct_parameters) {
    1.46 @@ -2740,7 +2740,7 @@
    1.47                                  struct mailmime_parameter * param = clist_content(cur);
    1.48                                  if (param && param->pa_name && strcasecmp(param->pa_name, "forwarded") == 0) {
    1.49                                      if (param->pa_value && strcasecmp(param->pa_value, "no") == 0) {
    1.50 -                                        *raise_msg_attachment = true;
    1.51 +                                        *has_possible_pEp_msg = true;
    1.52                                          break;
    1.53                                      }
    1.54                                  }
    1.55 @@ -2834,18 +2834,8 @@
    1.56  DYNAMIC_API PEP_STATUS mime_decode_message(
    1.57          const char *mimetext,
    1.58          size_t size,
    1.59 -        message **msg
    1.60 -    )
    1.61 -{
    1.62 -    return _mime_decode_message_internal(mimetext, size, msg, NULL);
    1.63 -}        
    1.64 -
    1.65 -
    1.66 -PEP_STATUS _mime_decode_message_internal(
    1.67 -        const char *mimetext,
    1.68 -        size_t size,
    1.69          message **msg,
    1.70 -        bool* raise_msg_attachment
    1.71 +        bool* has_possible_pEp_msg
    1.72      )
    1.73  {
    1.74      PEP_STATUS status = PEP_STATUS_OK;
    1.75 @@ -2889,7 +2879,7 @@
    1.76  
    1.77      if (content) {
    1.78          status = interpret_MIME(mime->mm_data.mm_message.mm_msg_mime,
    1.79 -                _msg, raise_msg_attachment);
    1.80 +                _msg, has_possible_pEp_msg);
    1.81          if (status != PEP_STATUS_OK)
    1.82              goto pEp_error;
    1.83      }