]> code.citadel.org Git - citadel.git/blobdiff - webcit/blogview_renderer.c
Ok, *this* is the way we want it structured internally.
[citadel.git] / webcit / blogview_renderer.c
index 42cf1abb0751588853664719730673622b26d59c..8dc7036e509e21765960e8752e2f9e330a700a79 100644 (file)
@@ -121,23 +121,30 @@ int blogview_sortfunc(const void *s1, const void *s2) {
 void blogview_learn_thread_references(struct blogpost *bp)
 {
        StrBuf *Buf;
+       StrBuf *r;
        Buf = NewStrBuf();
+       r = NewStrBuf();
        serv_printf("MSG0 %ld|1", bp->msgnum);          /* top level citadel headers only */
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) == 1) {
                while (StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
                        if (!strncasecmp(ChrPtr(Buf), "msgn=", 5)) {
                                StrBufCutLeft(Buf, 5);
+                               wc_printf("id %s, ", ChrPtr(Buf));
                                bp->id = HashLittle(ChrPtr(Buf), StrLength(Buf));
                        }
                        else if (!strncasecmp(ChrPtr(Buf), "wefw=", 5)) {
                                StrBufCutLeft(Buf, 5);          /* trim the field name */
-                               StrBufCutAt(Buf, 0, "|");       /* trim all but the first thread ref */
-                               bp->refs = HashLittle(ChrPtr(Buf), StrLength(Buf));
+                               wc_printf("refs %s, ", ChrPtr(Buf));
+                               StrBufExtract_token(r, Buf, 0, '|');
+                               wc_printf("topref %s, ", ChrPtr(r));
+                               bp->refs = HashLittle(ChrPtr(r), StrLength(r));
                        }
                }
+               wc_printf("<br>\n");
        }
        FreeStrBuf(&Buf);
+       FreeStrBuf(&r);
 }
 
 
@@ -173,6 +180,7 @@ int blogview_render(SharedMessageStatus *Stat, void **ViewSpecific, long oper)
         * * etc
         */
 
+       wc_printf("<hr>\n");
 
        for (i=0; (i<BLOG->num_msgs); ++i) {
                if (BLOG->msgs[i].msgnum > 0L) {