]> code.citadel.org Git - citadel.git/blobdiff - webcit/msg_renderers.c
* use SmashStrBuf where apropriate
[citadel.git] / webcit / msg_renderers.c
index 55411e22860ca66eab9acb336aa717a09b6a1822..5e88b91721be8f03cc0fde5e20969be01a903411 100644 (file)
@@ -509,9 +509,12 @@ void render_MIME_VNote(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundC
        if (StrLength(Mime->Data) > 0) {
                struct vnote *v;
                StrBuf *Buf;
+               char *vcard;
 
                Buf = NewStrBuf();
-               v = vnote_new_from_str(ChrPtr(Mime->Data));
+               vcard = SmashStrBuf(&Mime->Data);
+               v = vnote_new_from_str(vcard);
+               free (vcard);
                if (v) {
                        WCTemplputParams TP;
                        
@@ -522,12 +525,10 @@ void render_MIME_VNote(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundC
                                   Buf, &TP);
                        
                        vnote_free(v);
-                       
-                       FreeStrBuf(&Mime->Data);
                        Mime->Data = Buf;
                }
                else
-                       FlushStrBuf(Mime->Data);
+                       Mime->Data = NewStrBuf();
        }
 
 }
@@ -1209,10 +1210,8 @@ readloop_struct rlid[] = {
 
 /* Spit out the new summary view. This is basically a static page, so clients can cache the layout, all the dirty work is javascript :) */
 void new_summary_view(void) {
-       begin_burst();
        DoTemplate(HKEY("msg_listview"),NULL,&NoCtx);
        DoTemplate(HKEY("trailing"),NULL,&NoCtx);
-       end_burst();
 }
 
 
@@ -1332,12 +1331,14 @@ int bbsview_PrintViewHeader(SharedMessageStatus *Stat, void **ViewSpecific)
                        Stat->maxmsgs = abs(Stat->maxmsgs);
 
        }
-       memset(&SubTP, 0, sizeof(WCTemplputParams));
-       SubTP.Filter.ContextType = CTX_STRBUF;
-       SubTP.Context = VS->MessageDropdown;
-       DoTemplate(HKEY("msg_listselector_top"), VS->BBViewToolBar, &SubTP);
-       StrBufAppendBuf(WC->WBuf, VS->BBViewToolBar, 0);
-       FlushStrBuf(VS->BBViewToolBar);
+       if (Stat->nummsgs > 0) {
+               memset(&SubTP, 0, sizeof(WCTemplputParams));
+               SubTP.Filter.ContextType = CTX_STRBUF;
+               SubTP.Context = VS->MessageDropdown;
+               DoTemplate(HKEY("msg_listselector_top"), VS->BBViewToolBar, &SubTP);
+               StrBufAppendBuf(WC->WBuf, VS->BBViewToolBar, 0);
+               FlushStrBuf(VS->BBViewToolBar);
+       }
        return 200;
 }