Minor tweaks to sitemap code
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 31 May 2011 17:37:25 +0000 (13:37 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 20:55:40 +0000 (20:55 +0000)
webcit/sitemap.c

index 715c7245ffbe2484a5d9967b07105b6d0448f99d..fe6c68908db8fa3967fd2d60867dd06dae51cb18 100644 (file)
@@ -54,7 +54,6 @@ void sitemap_do_bbs(void) {
 
 /*
  * XML sitemap generator -- go through the message list for a wiki room
- * (this might work for blogs too; we'll see)
  */
 void sitemap_do_wiki(void) {
        wcsession *WCC = WC;
@@ -121,23 +120,23 @@ void sitemap(void) {
 
        while (GetNextHashPos(roomlist, it, &HKlen, &HashKey, (void *)&room))
        {
+               gotoroom(room->name);
+
                /* Output the messages in this room only if it's a room type we can make sense of */
                switch(room->defview) {
-               case VIEW_BBS:
-                       gotoroom(room->name);
-                       sitemap_do_bbs();
-                       break;
-               case VIEW_WIKI:
-                       gotoroom(room->name);
-                       sitemap_do_wiki();
-                       break;
-               default:
-                       break;
+                       case VIEW_BBS:
+                               sitemap_do_bbs();
+                               break;
+                       case VIEW_WIKI:
+                               sitemap_do_wiki();
+                               break;
+                       default:
+                               break;
                }
        }
 
        DeleteHashPos(&it);
-       /* DeleteHash(&roomlist); This will be freed when the session closes */
+       /* No need to DeleteHash(&roomlist) -- it will be freed when the session closes */
 
        wc_printf("</urlset>\r\n");
        wDumpContent(0);