X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsmtpqueue.c;h=b5c750a311a1b4106a9072b8ae20f3e51db4996a;hb=HEAD;hp=8bf02a7f60f8cb752d5aee22a2528e1fe3b74885;hpb=f77abc65a2ec7e662ac383a9fc3a9739d1142b2d;p=citadel.git diff --git a/webcit/smtpqueue.c b/webcit/smtpqueue.c index 8bf02a7f6..b5c750a31 100644 --- a/webcit/smtpqueue.c +++ b/webcit/smtpqueue.c @@ -3,6 +3,8 @@ */ #include "webcit.h" +CtxType CTX_MAILQITEM = CTX_NONE; +CtxType CTX_MAILQ_RCPT = CTX_NONE; HashList *QItemHandlers = NULL; @@ -294,19 +296,20 @@ void QItem_Handle_Attempted(OneQueItem *Item, StrBuf *Line, const char **Pos) - - - - -void render_QUEUE(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset) +void render_QUEUE(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset) { + wc_mime_attachment *Mime = CTX(CTX_MIME_ATACH); WCTemplputParams SubTP; + OneQueItem* Context; - memset(&SubTP, 0, sizeof(WCTemplputParams)); - SubTP.Filter.ContextType = CTX_MAILQITEM; - SubTP.Context = DeserializeQueueItem(Mime->Data, Mime->msgnum); - DoTemplate(HKEY("view_mailq_message"),NULL, &SubTP); - FreeQueItem ((OneQueItem**)&SubTP.Context); + Context = DeserializeQueueItem(Mime->Data, Mime->msgnum); + StackContext(TP, &SubTP, Context, CTX_MAILQITEM, 0, TP->Tokens); + { + DoTemplate(HKEY("view_mailq_message"), NULL, &SubTP); + } + UnStackContext(&SubTP); + + FreeQueItem (&Context); } void @@ -370,7 +373,7 @@ int qview_LoadMsgFromServer(SharedMessageStatus *Stat, const StrBuf *Mime; /* Not (yet?) needed here? calview *c = (calview *) *ViewSpecific; */ - read_message(WCC->WBuf, HKEY("view_mailq_message_bearer"), Msg->msgnum, NULL, &Mime); + read_message(WCC->WBuf, HKEY("view_mailq_message_bearer"), Msg->msgnum, NULL, &Mime, NULL); return 0; } @@ -383,6 +386,7 @@ int qview_RenderView_or_Tail(SharedMessageStatus *Stat, wcsession *WCC = WC; WCTemplputParams SubTP; + memset(&SubTP, 0, sizeof(WCTemplputParams)); if (yesbstr("ListOnly")) DoTemplate(HKEY("view_mailq_footer_listonly"),NULL, &SubTP); else @@ -406,6 +410,8 @@ void InitModule_SMTP_QUEUE (void) { + RegisterCTX(CTX_MAILQITEM); + RegisterCTX(CTX_MAILQ_RCPT); RegisterQItemHandler(HKEY("msgid"), QItem_Handle_MsgID); RegisterQItemHandler(HKEY("envelope_from"), QItem_Handle_EnvelopeFrom); @@ -423,7 +429,7 @@ InitModule_SMTP_QUEUE RegisterNamespace("MAILQ:SUBMITTED", 0, 0, tmplput_MailQSubmitted, NULL, CTX_MAILQITEM); RegisterNamespace("MAILQ:ENVELOPEFROM", 0, 1, tmplput_MailQEnvelopeFrom, NULL, CTX_MAILQITEM); RegisterNamespace("MAILQ:SRCROOM", 0, 1, tmplput_MailQSourceRoom, NULL, CTX_MAILQITEM); - RegisterConditional(HKEY("COND:MAILQ:HAVESRCROOM"), 0, Conditional_MailQ_HaveSourceRoom, CTX_MAILQITEM); + RegisterConditional("COND:MAILQ:HAVESRCROOM", 0, Conditional_MailQ_HaveSourceRoom, CTX_MAILQITEM); RegisterNamespace("MAILQ:RETRY", 0, 0, tmplput_MailQRetry, NULL, CTX_MAILQITEM); RegisterNamespace("MAILQ:RCPT:ADDR", 0, 1, tmplput_MailQRCPT, NULL, CTX_MAILQ_RCPT); @@ -442,6 +448,7 @@ InitModule_SMTP_QUEUE NULL, qview_LoadMsgFromServer, qview_RenderView_or_Tail, - qview_Cleanup); + qview_Cleanup, + NULL); }