src/etpan_mime.c
branchENGINE-9
changeset 1829 909cb53fc069
parent 1517 f29830f1c407
child 1871 51337eb65533
     1.1 --- a/src/etpan_mime.c	Tue Jun 06 18:00:40 2017 +0200
     1.2 +++ b/src/etpan_mime.c	Wed Jun 07 13:41:45 2017 +0200
     1.3 @@ -630,6 +630,29 @@
     1.4      return NULL;
     1.5  }
     1.6  
     1.7 +// FIXME: We should combine this with _get_filename, IMHO
     1.8 +char * _get_content_id(struct mailmime *mime) {
     1.9 +    clist * _fieldlist = NULL;
    1.10 +
    1.11 +    assert(mime);
    1.12 +
    1.13 +    if (mime->mm_mime_fields && mime->mm_mime_fields->fld_list)
    1.14 +        _fieldlist = mime->mm_mime_fields->fld_list;
    1.15 +    else
    1.16 +        return NULL;
    1.17 +
    1.18 +    clistiter *cur;
    1.19 +    for (cur = clist_begin(_fieldlist); cur; cur = clist_next(cur)) {
    1.20 +        struct mailmime_field * _field = clist_content(cur);
    1.21 +        if (_field && _field->fld_type == MAILMIME_FIELD_ID) {
    1.22 +            return _field->fld_data.fld_id; // returns NULL if it's not there, so...
    1.23 +        }
    1.24 +    }
    1.25 +
    1.26 +    return NULL;
    1.27 +}
    1.28 +
    1.29 +
    1.30  static bool parameter_has_value(
    1.31          struct mailmime_content *content,       
    1.32          const char *name,
    1.33 @@ -784,4 +807,3 @@
    1.34  
    1.35      return EINVAL;
    1.36  }
    1.37 -