Browse Source

Merge branch 'master' into APPLEMAIL-59

master
Andreas Buff 11 months ago
parent
commit
cd916e35ad
4 changed files with 5 additions and 4 deletions
  1. +2
    -2
      src/attachment.hh
  2. +1
    -1
      src/header_generator.cc
  3. +1
    -1
      src/headerparser.cc
  4. +1
    -0
      src/pEpMIME_internal.hh

+ 2
- 2
src/attachment.hh View File

@ -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) }


+ 1
- 1
src/header_generator.cc View File

@ -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() ;


+ 1
- 1
src/headerparser.cc View File

@ -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;
}


+ 1
- 0
src/pEpMIME_internal.hh View File

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


Loading…
Cancel
Save