Merge branch 'master' into APPLEMAIL-59

master
Andreas Buff 2 years ago
commit cd916e35ad

@ -19,7 +19,7 @@ namespace pEpMIME
{
explicit Attachment(const bloblist_t* b, unsigned nr_in_bloblist, bool has_pEp_msg_attachment)
: data{b->size ? sv{b->value, b->size} : sv{}}
, mime_type{b->mime_type}
, mime_type{exists(b->mime_type) ? b->mime_type : "application/octet-stream"}
, filename{exists(b->filename) ? b->filename : sv{}}
, dtype{b->disposition}
, need_te{need_transport_encoding(data)}
@ -37,7 +37,7 @@ namespace pEpMIME
Attachment(sv _data, sv _mime_type)
: data{_data}
, mime_type{_mime_type}
, mime_type{_mime_type.size() ? _mime_type : "application/octet-stream"}
, filename{}
, dtype{ PEP_CONTENT_DISP_OTHER }
, need_te{ need_transport_encoding(data) }

@ -89,7 +89,7 @@ namespace
void generate(std::string& out, sv header_name, const pEp_identity* id)
{
LOG << "GEN_ID: " << id->username << " | " << id->address << std::endl;
LOG << "GEN_ID: " << NN(id->username) << " | " << NN(id->address) << std::endl;
static BasicRules br;
out += exists(id->username) ? encode_header_if_necessary(br.phrase, header_name, id->username, qp::Word) + " " : std::string() ;

@ -41,7 +41,7 @@ std::string robust_to_utf8(sv s)
// NUL bytes confuse C code, especially the Engine.
// MIME-15: remove all C0 control characters.
ret.erase( std::remove_if(ret.begin(), ret.end(), [](char c){ return uint8_t(c) < ' '; } ), ret.end() );
ret.erase( std::remove_if(ret.begin(), ret.end(), [](char c){ return uint8_t(c) < ' ' || c=='\177'; } ), ret.end() );
return ret;
}

@ -37,6 +37,7 @@
#endif // C++17 switch
#define NN(str) ( (str) ? (str) : "(NULL)" )
#ifdef LOG_TO_STDERR
#include <iostream>

Loading…
Cancel
Save