return Msg->nhdr != 0;
}
-
void examine_type(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
{
Msg->format_type = StrToi(HdrLine);
message_summary *Msg = (message_summary*) CTX;
return StrLength(Msg->Rfca) > 0;
}
+int Conditional_MAIL_SUMM_CCCC(StrBuf *Target, WCTemplputParams *TP)
+{
+ message_summary *Msg = (message_summary*) CTX;
+ return StrLength(Msg->cccc) > 0;
+}
void examine_node(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
{
HashList *iterate_get_mailsumm_All(StrBuf *Target, WCTemplputParams *TP)
{
- return WC->summ;
+ return WC->summ;
}
int Conditional_ROOM_DISPLAY_MSG(StrBuf *Target, WCTemplputParams *TP) {
- //message_summary *Msg = (message_summary *) CTX;
- wcsubst *subst;
- wcsession *WCC = WC;
- GetHash(WCC->vars, HKEY("ITERATE:N"), (void *)&subst);
- long num_inset = subst->lvalue;
- if ((num_inset >= WC->startmsg) && (WCC->num_displayed <= WCC->maxmsgs)) {
- WCC->num_displayed = WCC->num_displayed+1;
- return 1; // Pass GO, collect $200
- }
- return 0;
+ wcsession *WCC = WC;
+ IterateStruct *ITC = CCTX;
+ int num_inset = ITC->n;
+ if ((num_inset >= WC->startmsg) && (WCC->num_displayed <= WCC->maxmsgs)) {
+
+ WCC->num_displayed = WCC->num_displayed+1;
+ return 1; /* Pass GO, collect $200 */
+ }
+ return 0;
}
int Conditional_MAIL_SUMM_LASTMSG(StrBuf *Target, WCTemplputParams *TP) {
- wcsubst *nsubst, *n_dsubst;
- long is_last_n;
-
- GetHash(WC->vars, HKEY("ITERATE:LASTN"), (void *)&nsubst);
- is_last_n = nsubst->lvalue;
-
- //GetHash(WC->vars, HKEY("ITERATE:N"), (void *)&n_dsubst);
- //num_inset = n_dsubst->lvalue;
-
- // Is the num_displayed higher than maxmsgs? OR last in iterator
- return ((WC->num_displayed > WC->maxmsgs) || (is_last_n == 1));
+ IterateStruct *ITC = CCTX;
+ int is_last_n = ITC->LastN;
+/*
+ //GetHash(WC->vars, HKEY("ITERATE:N"), (void *)&n_dsubst);
+ //num_inset = n_dsubst->lvalue;
+ */
+ /* Is the num_displayed higher than maxmsgs? OR last in iterator */
+ return ((WC->num_displayed > WC->maxmsgs) || (is_last_n == 1));
}
void examine_time(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
{
if ((StrLength(Mime->Data) == 0) && (Mime->length > 0)) {
FreeStrBuf(&Mime->Data);
- Mime->Data = NewStrBufPlain(NULL, Mime->length);
- if (!read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, 0, Mime->PartNum))
- return;
+ MimeLoadData(Mime);
}
/* Boring old 80-column fixed format text gets handled this way... */
iconv_close(ic);
}
#endif
+
FreeStrBuf(&Mime->Data);
Mime->Data = Target;
+ FlushStrBuf(Mime->ContentType);
+ StrBufAppendBufPlain(Mime->ContentType, HKEY("text/html"), 0);
+ FlushStrBuf(Mime->Charset);
+ StrBufAppendBufPlain(Mime->Charset, HKEY("UTF-8"), 0);
FreeStrBuf(&Line);
FreeStrBuf(&Line1);
FreeStrBuf(&Line2);
/* HTML is fun, but we've got to strip it first */
output_html(ChrPtr(Mime->Charset),
(WC->wc_view == VIEW_WIKI ? 1 : 0),
- StrToi(Mime->PartNum),
+ Mime->msgnum,
Mime->Data, Buf);
FreeStrBuf(&Mime->Data);
Mime->Data = Buf;
RegisterConditional(HKEY("COND:ROOM:DISPLAYMSG"), 0, Conditional_ROOM_DISPLAY_MSG, CTX_MAILSUM);
RegisterConditional(HKEY("COND:MAIL:SUMM:LASTMSG"), 0, Conditional_MAIL_SUMM_LASTMSG, CTX_MAILSUM);
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);
RegisterConditional(HKEY("COND:MAIL:SUMM:H_NODE"), 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
RegisterConditional(HKEY("COND:MAIL:SUMM:OTHERNODE"), 0, Conditional_MAIL_SUMM_OTHERNODE, CTX_MAILSUM);
RegisterConditional(HKEY("COND:MAIL:ANON"), 0, Conditional_ANONYMOUS_MESSAGE, CTX_MAILSUM);
-
+
/* do we have mimetypes to iterate over? */
RegisterConditional(HKEY("COND:MAIL:MIME:ATTACH"), 0, Conditional_MAIL_MIME_ALL, CTX_MAILSUM);