StrBufAppendPrintf(Target, "%ld", mime->length);
}
+HashList *iterate_get_registered_Attachments(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
+{
+ return WC->attachments;
+}
+
+void tmplput_ATT_Length(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType)
+{
+ wc_attachment *att = (wc_attachment*) Context;
+ StrBufAppendPrintf(Target, "%ld", att->length);
+}
+
+void tmplput_ATT_Contenttype(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType)
+{
+ wc_attachment *att = (wc_attachment*) Context;
+ StrBufAppendBuf(Target, att->content_type, 0);
+}
+
+void tmplput_ATT_FileName(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType)
+{
+ wc_attachment *att = (wc_attachment*) Context;
+ StrBufAppendBuf(Target, att->filename, 0);
+}
+
+
RegisterNamespace("MAIL:SUMM:INREPLYTO", 0, 2, tmplput_MAIL_SUMM_INREPLYTO, CTX_MAILSUM);
RegisterNamespace("MAIL:BODY", 0, 2, tmplput_MAIL_BODY, CTX_MAILSUM);
+ RegisterNamespace("ATT:SIZE", 0, 1, tmplput_ATT_Length, CTX_ATT);
+ RegisterNamespace("ATT:TYPE", 0, 1, tmplput_ATT_Contenttype, CTX_ATT);
+ RegisterNamespace("ATT:FILENAME", 0, 1, tmplput_ATT_FileName, CTX_ATT);
RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
RegisterConditional(HKEY("COND:MAIL:SUMM:H_NODE"), 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
RegisterNamespace("MAIL:MIME:LENGTH", 0, 2, tmplput_MIME_Length, CTX_MIME_ATACH);
RegisterNamespace("MAIL:MIME:DATA", 0, 2, tmplput_MIME_Data, CTX_MIME_ATACH);
-
+ RegisterIterator("MSG:ATTACHNAMES", 0, NULL, iterate_get_registered_Attachments,
+ NULL, NULL, CTX_ATT, CTX_NONE);
RegisterMimeRenderer(HKEY("message/rfc822"), render_MAIL);
RegisterMimeRenderer(HKEY("text/x-vcard"), render_MIME_VCard);