aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-11-04 17:49:06 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-11-04 17:49:16 -0800
commit4f5e05efe00f7f6efcda99812cd9ae70c449b444 (patch)
treec7a42ad92f9fedec333da31afa78f38e5fe8a197
parent47c53abcb15f5241872c8dc89017b547551919d7 (diff)
Tweaked template for attachments
-rw-r--r--src/core/renderer/MCHTMLRendererCallback.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/renderer/MCHTMLRendererCallback.cc b/src/core/renderer/MCHTMLRendererCallback.cc
index 93c0a409..edaf7e92 100644
--- a/src/core/renderer/MCHTMLRendererCallback.cc
+++ b/src/core/renderer/MCHTMLRendererCallback.cc
@@ -150,6 +150,10 @@ mailcore::HashMap * HTMLRendererTemplateCallback::templateValuesForPart(mailcore
if (filename != NULL) {
result->setObjectForKey(MCSTR("FILENAME"), filename->htmlEncodedString());
+ result->setObjectForKey(MCSTR("HASFILENAME"), mailcore::HashMap::hashMap());
+ }
+ else {
+ result->setObjectForKey(MCSTR("NOFILENAME"), mailcore::HashMap::hashMap());
}
if (part->className()->isEqual(MCSTR("mailcore::IMAPPart"))) {
@@ -219,10 +223,20 @@ mailcore::String * HTMLRendererTemplateCallback::templateForImage(AbstractPart *
mailcore::String * HTMLRendererTemplateCallback::templateForAttachment(AbstractPart * part)
{
return MCSTR("{{#HASSIZE}}\
+ {{#HASFILENAME}}\
<div>- {{FILENAME}}, {{SIZE}}</div>\
+ {{/HASFILENAME}}\
+ {{#NOFILENAME}}\
+ <div>- Untitled, {{SIZE}}</div>\
+ {{/NOFILENAME}}\
{{/HASSIZE}}\
{{#NOSIZE}}\
+ {{#HASFILENAME}}\
<div>- {{FILENAME}}</div>\
+ {{/HASFILENAME}}\
+ {{#NOFILENAME}}\
+ <div>- Untitled</div>\
+ {{/NOFILENAME}}\
{{/NOSIZE}}\
");
}