Hüttemann Detlef
"Hüttemann Detlef"<somebody@cosmocode.de>,Wilfried Goesgens <me.in@o3sis.com>, Lang Adrian <somebodyelse@cosmocode.de>, Gohr Andreas <da_splitbaiin@cosmocode.de>
Holger Müller
+=?utf-8?Q?voycontigo_-_5_Jahre_Barfu=C3=9Fschuhexperten!?= <info@voycontigo.de>.
+=?utf-8?B?6LS56bqf5Y2T?= <ygfyy@st.net>.
}
}
if (BBS->msgs[i] > 0L) {
- read_message(WC->WBuf, HKEY("view_message"), BBS->msgs[i], NULL, &Mime);
+ read_message(WC->WBuf, HKEY("view_message"), BBS->msgs[i], NULL, &Mime, NULL);
}
if (
(i == (BBS->num_msgs - 1))
/*
* Render a single blog post and (optionally) its comments
*/
-void blogpost_render(blogpost *bp, int with_comments)
+void blogpost_render(blogpost *bp, int with_comments, WCTemplputParams *TP)
{
wcsession *WCC = WC;
WCTemplputParams SubTP;
const StrBuf *Mime;
int i;
- memset(&SubTP, 0, sizeof(WCTemplputParams));
- StackContext(NULL, &SubTP, bp, CTX_BLOGPOST, 0, NULL);
+ memset(&SubTP, 0, sizeof(WCTemplputParams));
+ StackContext(TP, &SubTP, bp, CTX_BLOGPOST, 0, NULL);
/* Always show the top level post, unless we somehow ended up with an empty list */
if (bp->num_msgs > 0) {
- read_message(WC->WBuf, HKEY("view_blog_post"), bp->msgs[0], NULL, &Mime);
+ read_message(WC->WBuf, HKEY("view_blog_post"), bp->msgs[0], NULL, &Mime, TP);
}
if (with_comments) {
DoTemplate(HKEY("view_blog_show_commentlink"), WCC->WBuf, &SubTP);
for (i=1; i<bp->num_msgs; ++i) {
- read_message(WC->WBuf, HKEY("view_blog_comment"), bp->msgs[i], NULL, &Mime);
+ read_message(WC->WBuf, HKEY("view_blog_comment"), bp->msgs[i], NULL, &Mime, &SubTP);
}
DoTemplate(HKEY("view_blog_comment_box"), WCC->WBuf, &SubTP);
}
int firstp = 0;
int maxp = 0;
WCTemplputParams SubTP;
+ WCTemplputParams StopSubTP;
blogpost oneBP;
memset(&SubTP, 0, sizeof(WCTemplputParams));
+ memset(&StopSubTP, 0, sizeof(WCTemplputParams));
memset(&oneBP, 0, sizeof(blogpost));
/* Comments are shown if we are only viewing a single blog post */
}
}
if (unread_count == 1) {
- blogpost_render(unread_bp, 1);
+ blogpost_render(unread_bp, 1, NULL);/// TODO other than null?
DeleteHashPos(&it);
return 0;
/* Now go through the list and render what we've got */
for (i=start_here; i<num_blogposts; ++i) {
+ int j = i - maxp;
+ if (j < 0) j = 0;
+ StackContext(NULL, &SubTP, &blogposts[j], CTX_BLOGPOST, 0, NULL);
if ((i > 0) && (i == start_here)) {
- int j = i - maxp;
- if (j < 0) j = 0;
-
StackContext(NULL, &SubTP, &blogposts[j], CTX_BLOGPOST, 0, NULL);
DoTemplate(HKEY("view_blog_post_start"), WCC->WBuf, &SubTP);
- UnStackContext(&SubTP);
}
if (i < (start_here + maxp)) {
- blogpost_render(blogposts[i], with_comments);
+ blogpost_render(blogposts[i], with_comments, &SubTP);
}
else if (i == (start_here + maxp)) {
- StackContext(NULL, &SubTP, &blogposts[i], CTX_BLOGPOST, 0, NULL);
+ StackContext(&SubTP, &StopSubTP, &blogposts[i], CTX_BLOGPOST, 0, NULL);
DoTemplate(HKEY("view_blog_post_stop"), WCC->WBuf, &SubTP);
- UnStackContext(&SubTP);
+ UnStackContext(&StopSubTP);
}
+ UnStackContext(&SubTP);
}
/* Done. We are only freeing the array of pointers; the data itself
* printable_view Nonzero to display a printable view
* section Optional for encapsulated message/rfc822 submessage
*/
-int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, const StrBuf *PartNum, const StrBuf **OutMime)
+int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, const StrBuf *PartNum, const StrBuf **OutMime, WCTemplputParams *TP)
{
StrBuf *Buf;
StrBuf *FoundCharset;
StrBufTrim(Buf);
StrBufLowerCase(Buf);
- StackContext(NULL, &SuperTP, Msg, CTX_MAILSUM, 0, NULL);
+ StackContext(TP, &SuperTP, Msg, CTX_MAILSUM, 0, NULL);
{
/* Locate a renderer capable of converting this MIME part into HTML */
if (GetHash(MimeRenderHandler, SKEY(Buf), &vHdr) &&
case ePOST:
Tmpl = sbstr("template");
if (StrLength(Tmpl) > 0)
- read_message(WCC->WBuf, SKEY(Tmpl), msgnum, NULL, &Mime);
+ read_message(WCC->WBuf, SKEY(Tmpl), msgnum, NULL, &Mime, NULL);
else
- read_message(WCC->WBuf, HKEY("view_message"), msgnum, NULL, &Mime);
+ read_message(WCC->WBuf, HKEY("view_message"), msgnum, NULL, &Mime, NULL);
http_transmit_thing(ChrPtr(Mime), 0);
break;
case eDELETE:
case ePOST:
Tmpl = sbstr("template");
if (StrLength(Tmpl) > 0)
- read_message(WCC->WBuf, SKEY(Tmpl), msgnum, NULL, &Mime);
+ read_message(WCC->WBuf, SKEY(Tmpl), msgnum, NULL, &Mime, NULL);
else
- read_message(WCC->WBuf, HKEY("view_message"), msgnum, NULL, &Mime);
+ read_message(WCC->WBuf, HKEY("view_message"), msgnum, NULL, &Mime, NULL);
http_transmit_thing(ChrPtr(Mime), 0);
break;
case eDELETE:
begin_burst();
- read_message(WC->WBuf, HKEY("view_message_print"), msgnum, NULL, &Mime);
+ read_message(WC->WBuf, HKEY("view_message_print"), msgnum, NULL, &Mime, NULL);
wDumpContent(0);
}
const char *tmpl, long tmpllen,
long msgnum,
const StrBuf *section,
- const StrBuf **OutMime);
+ const StrBuf **OutMime,
+ WCTemplputParams *TP);
int load_message(message_summary *Msg,
StrBuf *FoundCharset,
StrBuf **Error);
Mime->Data = NewStrBufPlain(NULL, Mime->length);
else
FlushStrBuf(Mime->Data);
- read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, Mime->PartNum, &TemplateMime);
+ read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, Mime->PartNum, &TemplateMime, TP);
/*
if ( (!IsEmptyStr(mime_submessages)) && (!section[0]) ) {
for (i=0; i<num_tokens(mime_submessages, '|'); ++i) {
MsgNum = LBstr(TKEY(0));
Buf = NewStrBuf();
- read_message(Buf, HKEY("view_message_replyquote"), MsgNum, NULL, &Mime);
+ read_message(Buf, HKEY("view_message_replyquote"), MsgNum, NULL, &Mime, TP);
StrBufAppendTemplate(Target, TP, Buf, 1);
FreeStrBuf(&Buf);
}
MsgNum = LBstr(TKEY(0));
Buf = NewStrBuf();
- read_message(Buf, HKEY("view_message_edit"), MsgNum, NULL, &Mime);
+ read_message(Buf, HKEY("view_message_edit"), MsgNum, NULL, &Mime, TP);
StrBufAppendTemplate(Target, TP, Buf, 1);
FreeStrBuf(&Buf);
}
free(wikipage);
if (msgnum >= 0L) {
Buf = NewStrBuf();
- read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime);
+ read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime, TP);
StrBufAppendTemplate(Target, TP, Buf, 1);
FreeStrBuf(&Buf);
}
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;
}
VS = (vcardview_struct*) *ViewSpecific;
if (VS->is_singlecard)
- read_message(WC->WBuf, HKEY("view_message"), lbstr("startmsg"), NULL, &Mime);
+ read_message(WC->WBuf, HKEY("view_message"), lbstr("startmsg"), NULL, &Mime, NULL);
else
do_addrbook_view(VS); /* Render the address book */
return 0;
}
if (msgnum >= 0L) {
- read_message(WCC->WBuf, HKEY("view_message"), msgnum, NULL, &Mime);
+ read_message(WCC->WBuf, HKEY("view_message"), msgnum, NULL, &Mime, NULL);
return;
}