void render_MAIL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset)
{
+ const StrBuf *TemplateMime;
+
Mime->Data = NewStrBufPlain(NULL, Mime->length);
- read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, 0, Mime->PartNum);
+ read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, Mime->PartNum, &TemplateMime);
/*
if ( (!IsEmptyStr(mime_submessages)) && (!section[0]) ) {
for (i=0; i<num_tokens(mime_submessages, '|'); ++i) {
void examine_text(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
{
- Msg->MsgBody->Data = NewStrBuf();
+ Msg->MsgBody->Data = NewStrBufPlain(NULL, SIZ);
}
void examine_msg4_partnum(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
/*----------------------------------------------------------------------------*/
void tmplput_QUOTED_MAIL_BODY(StrBuf *Target, WCTemplputParams *TP)
{
+ const StrBuf *Mime;
+ long MsgNum;
+ StrBuf *Buf;
+
+ MsgNum = LBstr(TKEY(0));
+ Buf = NewStrBuf();
+ read_message(Buf, HKEY("view_message_replyquote"), MsgNum, NULL, &Mime);
+ StrBufAppendTemplate(Target, TP, Buf, 1);
+ FreeStrBuf(&Buf);
+}
+
+void tmplput_EDIT_MAIL_BODY(StrBuf *Target, WCTemplputParams *TP)
+{
+ const StrBuf *Mime;
long MsgNum;
StrBuf *Buf;
MsgNum = LBstr(TKEY(0));
Buf = NewStrBuf();
- read_message(Buf, HKEY("view_message_replyquote"), MsgNum, 0, NULL);
+ read_message(Buf, HKEY("view_message_edit"), MsgNum, NULL, &Mime);
StrBufAppendTemplate(Target, TP, Buf, 1);
FreeStrBuf(&Buf);
}
}
}
#endif
- Line = NewStrBuf();
- Line1 = NewStrBuf();
- Line2 = NewStrBuf();
+ Line = NewStrBufPlain(NULL, SIZ);
+ Line1 = NewStrBufPlain(NULL, SIZ);
+ Line2 = NewStrBufPlain(NULL, SIZ);
Target = NewStrBufPlain(NULL, StrLength(Mime->Data));
while ((n = StrBufSipLine(Line, Mime->Data, &BufPtr), n >= 0) && !done)
void SetAccessCommand(long Oper)
{
+/* TODO: whats achieved by this?
wcsession *WCC = WC;
if (WCC->UrlFragment1 != NULL ) {
}
else
WCC->UrlFragment1 = NewStrBufPlain(rlid[Oper].name.Key, rlid[Oper].name.len);
+*/
}
RegisterNamespace("MAIL:SUMM:INREPLYTO", 0, 2, tmplput_MAIL_SUMM_INREPLYTO, CTX_MAILSUM);
RegisterNamespace("MAIL:BODY", 0, 2, tmplput_MAIL_BODY, CTX_MAILSUM);
RegisterNamespace("MAIL:QUOTETEXT", 1, 2, tmplput_QUOTED_MAIL_BODY, CTX_NONE);
+ RegisterNamespace("MAIL:EDITTEXT", 1, 2, tmplput_EDIT_MAIL_BODY, CTX_NONE);
RegisterConditional(HKEY("COND:MAIL:SUMM:RFCA"), 0, Conditional_MAIL_SUMM_RFCA, CTX_MAILSUM);
RegisterConditional(HKEY("COND:MAIL:SUMM:CCCC"), 0, Conditional_MAIL_SUMM_CCCC, CTX_MAILSUM);
RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
RegisterMsgHdr(HKEY("suff"), examine_suff, 0);
RegisterMsgHdr(HKEY("path"), examine_path, 0);
}
+
+void
+ServerStartModule_MSGRENDERERS
+(void)
+{
+ MsgHeaderHandler = NewHash(1, NULL);
+ MimeRenderHandler = NewHash(1, NULL);
+}
+
+void
+ServerShutdownModule_MSGRENDERERS
+(void)
+{
+ DeleteHash(&MsgHeaderHandler);
+ DeleteHash(&MimeRenderHandler);
+}
+
+
+
+void
+SessionDestroyModule_MSGRENDERERS
+(wcsession *sess)
+{
+ DeleteHash(&sess->attachments);
+}