--- a/src/XMLDocumentConstructor.h Sun Feb 07 00:33:37 2021 +0100
+++ b/src/XMLDocumentConstructor.h Sun Feb 07 00:51:08 2021 +0100
@@ -94,9 +94,9 @@
std::string fetchBodyBinary(std::shared_ptr<vmime::body> body) {
std::stringstream result;
- vmime::utility::outputStreamAdapter binaryResultAdapter(result);
- body->getContents()->extract(binaryResultAdapter);
- binaryResultAdapter.flush();
+ vmime::utility::outputStreamAdapter resultAdapter(result);
+ body->getContents()->extract(resultAdapter);
+ resultAdapter.flush();
return toHex(result.str());
}
@@ -104,6 +104,7 @@
element->set_attribute("content-type", format(body->getContentType()));
// element->set_attribute("content-type-charset", body->getCharset().getName());
// element->set_attribute("content-transfer-encoding", body->getEncoding().getName());
+ // TODO: size of raw data
if (body->getPartCount() == 0) {
if (body->getContentType().getType() == "text") element->add_child_cdata(fetchBodyText(body));
@@ -191,7 +192,7 @@
field->add_child_text(value->getId());
} else if (auto value = mimeField->getValue<vmime::messageIdSequence>()) {
for (auto messageId : value->getMessageIdList()) {
- xmlpp::Element* messageIdField = field->add_child("Mssage-ID"); // TODO: lower case?
+ xmlpp::Element* messageIdField = field->add_child("message-id");
messageIdField->add_child_text(messageId->getId());
}
} else if (auto value = mimeField->getValue<vmime::contentDisposition>()) {