X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fctdlproto%2Fserv_rooms.c;h=09fb30061426e361b8d814540c0be3cf4243f358;hb=a4570bee71e9c8797b6d50ec1644efd234377707;hp=9df142cd04b96579a7c74468fbca82dccc2824d7;hpb=3052311a6d7a2b14d2ff24edff6344cf1ae109b4;p=citadel.git diff --git a/citadel/modules/ctdlproto/serv_rooms.c b/citadel/modules/ctdlproto/serv_rooms.c index 9df142cd0..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); } @@ -931,7 +922,6 @@ void cmd_einf(char *ok) /* now update the room index so people will see our new info */ CtdlGetRoomLock(&CCC->room, CCC->room.QRname); /* lock so no one steps on us */ - CCC->room.QRinfo = CCC->room.QRhighest + 1L; CtdlPutRoomLock(&CCC->room); }