From a4570bee71e9c8797b6d50ec1644efd234377707 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 19 Apr 2016 17:57:17 -0400 Subject: [PATCH] RINF command migrated to new data format --- citadel/modules/ctdlproto/serv_rooms.c | 29 +++++++++----------------- citadel/room_ops.c | 9 -------- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/citadel/modules/ctdlproto/serv_rooms.c b/citadel/modules/ctdlproto/serv_rooms.c index fa3d23ac4..09fb30061 100644 --- a/citadel/modules/ctdlproto/serv_rooms.c +++ b/citadel/modules/ctdlproto/serv_rooms.c @@ -708,29 +708,20 @@ void cmd_seta(char *new_ra) } /* - * retrieve info file for this room + * Retrieve info file for this room (this ought to be upgraded to handle non-plain-text) */ -void cmd_rinf(char *gargs) +void cmd_rinf(char *argbuf) { - char filename[PATH_MAX]; - char buf[SIZ]; - FILE *info_fp; - - assoc_file_name(filename, sizeof filename, &CC->room, ctdl_info_dir); - info_fp = fopen(filename, "r"); - - if (info_fp == NULL) { - cprintf("%d No info file.\n", ERROR + FILE_NOT_FOUND); - return; + struct CtdlMessage *msg = CtdlFetchMessage(CC->room.msgnum_info, 1, 1); + if (msg != NULL) { + cprintf("%d Info:\n", LISTING_FOLLOWS); + CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_NONE, 0, 0, 0); + CM_Free(msg); + cprintf("000\n"); } - cprintf("%d Info:\n", LISTING_FOLLOWS); - while (fgets(buf, sizeof buf, info_fp) != NULL) { - if (!IsEmptyStr(buf)) - buf[strlen(buf) - 1] = 0; - cprintf("%s\n", buf); + else { + cprintf("%d No info file.\n", ERROR + FILE_NOT_FOUND); } - cprintf("000\n"); - fclose(info_fp); } diff --git a/citadel/room_ops.c b/citadel/room_ops.c index 74adefb86..5b358b609 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -1130,19 +1130,10 @@ void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf) void CtdlDeleteRoom(struct ctdlroom *qrbuf) { struct floor flbuf; - char filename[PATH_MAX]; char configdbkeyname[25]; syslog(LOG_NOTICE, "Deleting room <%s>", qrbuf->QRname); - /* Delete the info file */ - assoc_file_name(filename, sizeof filename, qrbuf, ctdl_info_dir); - unlink(filename); - - /* Delete the image file */ - assoc_file_name(filename, sizeof filename, qrbuf, ctdl_image_dir); - unlink(filename); - /* Delete the room's network configdb entry */ netcfg_keyname(configdbkeyname, qrbuf->QRnumber); CtdlDelConfig(configdbkeyname); -- 2.30.2