|
|
|
@ -17,12 +17,13 @@ namespace pEpMIME
|
|
|
|
|
// refers to data in a bloblist_t. Does NOT any data!
|
|
|
|
|
struct Attachment
|
|
|
|
|
{
|
|
|
|
|
explicit Attachment(const bloblist_t* b)
|
|
|
|
|
explicit Attachment(const bloblist_t* b, unsigned nr_in_bloblist)
|
|
|
|
|
: data{b->size ? sv{b->value, b->size} : sv{}}
|
|
|
|
|
, mime_type{b->mime_type}
|
|
|
|
|
, filename{exists(b->filename) ? b->filename : sv{}}
|
|
|
|
|
, dtype{b->disposition}
|
|
|
|
|
, need_te{need_transport_encoding(data)}
|
|
|
|
|
, nr{nr_in_bloblist}
|
|
|
|
|
{
|
|
|
|
|
if(::pEpMIME::is_inline(b))
|
|
|
|
|
{
|
|
|
|
@ -30,12 +31,13 @@ namespace pEpMIME
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Attachment(sv _data, sv _mime_type)
|
|
|
|
|
Attachment(sv _data, sv _mime_type, unsigned nr_in_bloblist)
|
|
|
|
|
: data{_data}
|
|
|
|
|
, mime_type{_mime_type}
|
|
|
|
|
, filename{}
|
|
|
|
|
, dtype{ PEP_CONTENT_DISP_OTHER }
|
|
|
|
|
, need_te{ need_transport_encoding(data) }
|
|
|
|
|
, nr{ nr_in_bloblist }
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -51,6 +53,7 @@ namespace pEpMIME
|
|
|
|
|
sv filename;
|
|
|
|
|
content_disposition_type dtype;
|
|
|
|
|
bool need_te; // need transport encoding
|
|
|
|
|
unsigned nr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef std::vector<Attachment> SAttachments;
|
|
|
|
|