X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fforum_view.c;h=0eeaf8566566729a6ea6ab4e46ea07c420f48a9c;hb=3da35ead77f2920042ddd54c3559d58a21abe3e3;hp=995a6e187ff28d176ed2a913da66bddf1c2c1a0e;hpb=a2e2b0eab5e29c1bd61ec21737d28d3cb70ee364;p=citadel.git diff --git a/webcit-ng/forum_view.c b/webcit-ng/forum_view.c index 995a6e187..0eeaf8566 100644 --- a/webcit-ng/forum_view.c +++ b/webcit-ng/forum_view.c @@ -173,6 +173,7 @@ void thread_o_print(struct ctdlsession *c, StrBuf *sj, struct mthread *m, int nu } } +#if 0 // Threaded view (entry point) // @@ -289,3 +290,23 @@ void flat_view(struct http_transaction *h, struct ctdlsession *c, char *which) h->response_body = SmashStrBuf(&sj); return; } + +#endif + +// render one message (entire transaction) +// +void html_render_one_message(struct http_transaction *h, struct ctdlsession *c, long msgnum) +{ + StrBuf *sj = NewStrBuf(); + StrBufAppendPrintf(sj, "\r\n"); + setup_for_forum_view(c); // FIXME way too inefficient to do this for every message !!!!!!!!!!!!! + forum_render_one_message(c, sj, msgnum); + StrBufAppendPrintf(sj, "\r\n"); + add_response_header(h, strdup("Content-type"), strdup("text/html; charset=utf-8")); + h->response_code = 200; + h->response_string = strdup("OK"); + h->response_body_length = StrLength(sj); + h->response_body = SmashStrBuf(&sj); + return; +} +