|
a/src/internfile/mh_mail.cpp |
|
b/src/internfile/mh_mail.cpp |
|
... |
|
... |
258 |
m_metaData[cstr_dj_keytitle] = att->m_filename + " (" + m_subject + ")";
|
258 |
m_metaData[cstr_dj_keytitle] = att->m_filename + " (" + m_subject + ")";
|
259 |
LOGDEB1(" processAttach:ct [" << att->m_contentType << "] cs [" <<
|
259 |
LOGDEB1(" processAttach:ct [" << att->m_contentType << "] cs [" <<
|
260 |
att->m_charset << "] fn [" << att->m_filename << "]\n");
|
260 |
att->m_charset << "] fn [" << att->m_filename << "]\n");
|
261 |
|
261 |
|
262 |
// Erase current content and replace
|
262 |
// Erase current content and replace
|
263 |
m_metaData[cstr_dj_keycontent] = string();
|
|
|
264 |
string& body = m_metaData[cstr_dj_keycontent];
|
263 |
string& body = m_metaData[cstr_dj_keycontent];
|
|
|
264 |
body.clear();
|
265 |
att->m_part->getBody(body, 0, att->m_part->bodylength);
|
265 |
att->m_part->getBody(body, 0, att->m_part->bodylength);
|
266 |
{
|
266 |
{
|
267 |
string decoded;
|
267 |
string decoded;
|
268 |
const string *bdp;
|
268 |
const string *bdp;
|
269 |
if (!decodeBody(att->m_contentTransferEncoding, body, decoded, &bdp)) {
|
269 |
if (!decodeBody(att->m_contentTransferEncoding, body, decoded, &bdp)) {
|
|
... |
|
... |
283 |
m_metaData[cstr_dj_keymt] = mt;
|
283 |
m_metaData[cstr_dj_keymt] = mt;
|
284 |
}
|
284 |
}
|
285 |
|
285 |
|
286 |
// Special case for text/plain content. Internfile should deal
|
286 |
// Special case for text/plain content. Internfile should deal
|
287 |
// with this but it expects text/plain to be utf-8 already, so we
|
287 |
// with this but it expects text/plain to be utf-8 already, so we
|
288 |
// handle the transcoding if needed
|
288 |
// handle the transcoding if needed. Same kind of issue for the MD5
|
289 |
if (m_metaData[cstr_dj_keymt] == cstr_textplain) {
|
289 |
if (m_metaData[cstr_dj_keymt] == cstr_textplain) {
|
290 |
if (!txtdcode("MimeHandlerMail::processAttach"))
|
290 |
if (!txtdcode("MimeHandlerMail::processAttach")) {
|
291 |
body.clear();
|
291 |
body.clear();
|
|
|
292 |
} else if (!m_forPreview) {
|
|
|
293 |
string md5, xmd5;
|
|
|
294 |
MD5String(body, md5);
|
|
|
295 |
m_metaData[cstr_dj_keymd5] = MD5HexPrint(md5, xmd5);
|
|
|
296 |
}
|
292 |
}
|
297 |
}
|
293 |
|
298 |
|
294 |
// Ipath
|
299 |
// Ipath
|
295 |
char nbuf[20];
|
300 |
char nbuf[20];
|
296 |
sprintf(nbuf, "%d", m_idx);
|
301 |
sprintf(nbuf, "%d", m_idx);
|