diff -r 10d2775fb628 src/internfile/internfile.cpp --- a/src/internfile/internfile.cpp Fri Jul 31 13:01:02 2015 +0200 +++ b/src/internfile/internfile.cpp Fri Jul 31 17:58:44 2015 +0200 @@ -551,6 +551,10 @@ // also set the author and modification time from the last doc which // has them. // +// The stack can contain objects with an ipath element (corresponding +// to actual embedded documents), and, at the top, elements without an +// ipath element, corresponding to format translations of the last doc. +// // The docsize is fetched from the first element without an ipath // (first non container). If the last element directly returns // text/plain so that there is no ipath-less element, the value will @@ -579,7 +583,8 @@ const map& docdata = (*hit)->get_meta_data(); if (getKeyValue(docdata, cstr_dj_keyipath, ipathel)) { if (!ipathel.empty()) { - // We have a non-empty ipath + // Non-empty ipath. This stack element is for an + // actual embedded document, not a format translation. hasipath = true; getKeyValue(docdata, cstr_dj_keymt, doc.mimetype); getKeyValue(docdata, cstr_dj_keyfn, doc.meta[Rcl::Doc::keyfn]); @@ -593,9 +598,19 @@ getKeyValue(docdata, cstr_dj_keydocsize, doc.fbytes); doc.ipath += cstr_isep; } + // We set the author field from the innermost doc which has + // one: allows finding, e.g. an image attachment having no + // metadata by a search on the sender name. Only do this for + // actually embedded documents (avoid replacing values from + // metacmds for the topmost one). For a topmost doc, author + // will be merged by dijontorcl() later on. About same for + // dmtime, but an external value will be replaced, not + // augmented if dijontorcl() finds an internal value. + if (hasipath) { getKeyValue(docdata, cstr_dj_keyauthor, doc.meta[Rcl::Doc::keyau]); getKeyValue(docdata, cstr_dj_keymd, doc.dmtime); } + } // Trim empty tail elements in ipath. if (hasipath) {