* just show the heading dropdown if we have messages to show.
authorWilfried Göesgens <willi@citadel.org>
Thu, 3 Sep 2009 21:53:15 +0000 (21:53 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 3 Sep 2009 21:53:15 +0000 (21:53 +0000)
webcit/msg_renderers.c

index 2ff94b66a30b7c2aa397830b00812391a9f0292c..f360ca3e6650f3e7e15a48b6209a64fdbbddcbb5 100644 (file)
@@ -1330,12 +1330,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;
 }