X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit-ng%2Fforum_view.c;h=354fcea01ff63eb9b96d993b5979993f947a57c1;hp=7745e019e199c7a5391f9ea92c172ad4fb713ecb;hb=5deb2bab5f248ea677c98d8b36b3d658520324ed;hpb=32fe7887a4fc68e8148f79c4b9ec35ffbb2442d7 diff --git a/webcit-ng/forum_view.c b/webcit-ng/forum_view.c index 7745e019e..354fcea01 100644 --- a/webcit-ng/forum_view.c +++ b/webcit-ng/forum_view.c @@ -292,3 +292,22 @@ void flat_view(struct http_transaction *h, struct ctdlsession *c, char *which) } #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; +} +