X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsitemap.c;h=cab60d43ec01307ceef379db619a34fe0a22c485;hb=4b4dc864ede7c5d8d956febe4a0afb422b78e7c4;hp=c79c82441d38f95a86fdf8016613e7e09165b9e6;hpb=494d819637ac8aeb02ec10d2d514edb189a71f1b;p=citadel.git diff --git a/webcit/sitemap.c b/webcit/sitemap.c index c79c82441..cab60d43e 100644 --- a/webcit/sitemap.c +++ b/webcit/sitemap.c @@ -36,7 +36,7 @@ void sitemap_do_bbs(void) { Stat.maxload = INT_MAX; Stat.lowest_found = (-1); Stat.highest_found = (-1); - num_msgs = load_msg_ptrs("MSGS ALL", &Stat, NULL); + num_msgs = load_msg_ptrs("MSGS ALL", NULL, &Stat, NULL); if (num_msgs < 1) return; for (i=0; iroomname = NewStrBufPlain(roomname_plain, -1); + ptr->defview = extract_int(buf, 6); + ptr->next = roomlist; + roomlist = ptr; + } + + return(roomlist); +} + + /* * Entry point for RSS feed generator */ void sitemap(void) { - HashList *roomlist = NULL; - HashPos *it = NULL; - long HKlen = 0; - const char *HashKey = NULL; - folder *room = NULL; - + struct sitemap_room_list *roomlist = NULL; output_headers(0, 0, 0, 0, 1, 0); hprintf("Content-type: text/xml\r\n"); hprintf( @@ -148,17 +173,14 @@ void sitemap(void) { wc_printf("\r\n"); wc_printf("\r\n"); - roomlist = GetRoomListHashLKRA(NULL, NULL); - if (!roomlist) syslog(LOG_CRIT, "GetRoomListHashLKRA() FAILED!"); - it = GetNewHashPos(roomlist, 0); - if (!it) syslog(LOG_CRIT, "GetNewHashPos() FAILED!"); + roomlist = sitemap_load_roomlist(); - while (GetNextHashPos(roomlist, it, &HKlen, &HashKey, (void *)&room)) + while (roomlist != NULL) { - gotoroom(room->name); + gotoroom(roomlist->roomname); /* Output the messages in this room only if it's a room type we can make sense of */ - switch(room->defview) { + switch(roomlist->defview) { case VIEW_BBS: sitemap_do_bbs(); break; @@ -171,10 +193,13 @@ void sitemap(void) { default: break; } + + struct sitemap_room_list *ptr = roomlist; + roomlist = roomlist->next; + FreeStrBuf(&ptr->roomname); + free(ptr); } - DeleteHashPos(&it); - DeleteHash(&WC->Rooms); /* roomlist is actually a pointer to WC->Rooms */ wc_printf("\r\n"); wDumpContent(0); }