aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/renderer/MCHTMLRenderer.cpp
diff options
context:
space:
mode:
authorGravatar Ken Grigsby <grigsby@thursby.com>2013-04-22 17:12:33 -0500
committerGravatar Ken Grigsby <grigsby@thursby.com>2013-04-22 17:12:33 -0500
commit525417569a211ce6cc1dc37bbd269cc5bd1bc2f2 (patch)
tree73dd16206a521984a5a26b479038a4d7300070c9 /src/core/renderer/MCHTMLRenderer.cpp
parentc1503e60ad020610c52df5a87d607c05cb50cc0b (diff)
Fixes for embedded messages and headers
Diffstat (limited to 'src/core/renderer/MCHTMLRenderer.cpp')
-rw-r--r--src/core/renderer/MCHTMLRenderer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/renderer/MCHTMLRenderer.cpp b/src/core/renderer/MCHTMLRenderer.cpp
index 71454a0e..7d03f650 100644
--- a/src/core/renderer/MCHTMLRenderer.cpp
+++ b/src/core/renderer/MCHTMLRenderer.cpp
@@ -328,17 +328,21 @@ String * htmlForAbstractSinglePart(AbstractPart * part, htmlRendererContext * co
String * htmlForAbstractMessagePart(AbstractMessagePart * part, htmlRendererContext * context)
{
- String * substring = htmlForAbstractPart(part->mainPart(), context);
if (context->pass == 0) {
return NULL;
}
+ String * substring = htmlForAbstractPart(part->mainPart(), context);
MCAssert(substring != NULL);
- String * result = String::string();
HashMap * values = context->htmlCallback->templateValuesForHeader(part->header());
String * headerString = renderTemplate(context->htmlCallback->templateForEmbeddedMessageHeader(), values);
- result->appendString(headerString);
- result->appendString(substring);
+
+ HashMap * msgValues = new HashMap();
+ msgValues->setObjectForKey(MCSTR("HEADER"), headerString);
+ msgValues->setObjectForKey(MCSTR("BODY"), substring);
+ String * result = renderTemplate(context->htmlCallback->templateForEmbeddedMessage(), msgValues);
+ msgValues->release();
+
return result;
}