From 655715fde9f23bbd59cd49f2189077598c428db0 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 19 Apr 2016 23:27:22 -0400 Subject: [PATCH] Use the new data format for RoomInfo in spoolcontrol (what is this for?) --- citadel/modules/network/serv_netspool.c | 28 +++++++++++-------------- citadel/modules/upgrade/serv_upgrade.c | 1 + 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index 3ebac02fe..b13f1b8ff 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -325,27 +325,23 @@ void InspectQueuedRoom(SpoolControl **pSC, void CalcListID(SpoolControl *sc) { StrBuf *RoomName; - const char *err; - int fd; struct CitContext *CCC = CC; - char filename[PATH_MAX]; #define MAX_LISTIDLENGTH 150 - assoc_file_name(filename, sizeof filename, &sc->room, ctdl_info_dir); - fd = open(filename, 0); - - if (fd > 0) { - struct stat stbuf; - - if ((fstat(fd, &stbuf) == 0) && - (stbuf.st_size > 0)) - { - sc->RoomInfo = NewStrBufPlain(NULL, stbuf.st_size + 1); - StrBufReadBLOB(sc->RoomInfo, &fd, 0, stbuf.st_size, &err); - } - close(fd); + // Load the room banner as the list description + struct CtdlMessage *msg = CtdlFetchMessage(sc->room.msgnum_info, 1, 1); + if (msg != NULL) { + CC->redirect_buffer = NewStrBufPlain(NULL, SIZ); + CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_NONE, 0, 0, 0); + CM_Free(msg); + sc->RoomInfo = CC->redirect_buffer; + CC->redirect_buffer = NULL; + } + else { + sc->RoomInfo = NewStrBufPlain(NULL, SIZ); } + // Calculate the List ID sc->ListID = NewStrBufPlain(NULL, 1024); if (StrLength(sc->RoomInfo) > 0) { diff --git a/citadel/modules/upgrade/serv_upgrade.c b/citadel/modules/upgrade/serv_upgrade.c index 4d3c50bd7..6ffe09773 100644 --- a/citadel/modules/upgrade/serv_upgrade.c +++ b/citadel/modules/upgrade/serv_upgrade.c @@ -365,6 +365,7 @@ void ingest_old_roominfo_and_roompic_files(void) il = p; } + unlink(ctdl_info_dir); } -- 2.30.2