From dd39f679c0bb3f9070896691acf5bd445e59e0b2 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 4 Jul 2012 12:26:39 -0400 Subject: [PATCH] new server command 'stat' to return name and mtime of current room --- citadel/citadel.h | 2 +- citadel/configure.ac | 2 +- citadel/room_ops.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index 9b0c36bab..0d1897220 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -45,7 +45,7 @@ extern "C" { * usually more strict because you're not really supposed to dump/load and * upgrade at the same time. */ -#define REV_LEVEL 812 /* This version */ +#define REV_LEVEL 813 /* This version */ #define REV_MIN 591 /* Oldest compatible database */ #define EXPORT_REV_MIN 760 /* Oldest compatible export files */ #define LIBCITADEL_MIN 812 /* Minimum required version of libcitadel */ diff --git a/citadel/configure.ac b/citadel/configure.ac index 7682cbb40..943a84571 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) -AC_INIT([Citadel], [8.12], [http://www.citadel.org/]) +AC_INIT([Citadel], [8.13], [http://www.citadel.org/]) AC_REVISION([$Revision: 5108 $]) AC_CONFIG_SRCDIR([citserver.c]) AC_CONFIG_HEADER(sysdep.h) diff --git a/citadel/room_ops.c b/citadel/room_ops.c index 4fb1501cd..3f08b0105 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -2278,6 +2278,19 @@ void cmd_eflr(char *argbuf) } + +/* + * cmd_stat() - return the modification time of the current room (maybe other things in the future) + */ +void cmd_stat(char *gargs) +{ + if (CtdlAccessCheck(ac_logged_in_or_guest)) return; + CtdlGetRoom(&CC->room, CC->room.QRname); + cprintf("%d %s|%ld|\n", CIT_OK, CC->room.QRname, CC->room.QRmtime); +} + + + /*****************************************************************************/ /* MODULE INITIALIZATION STUFF */ /*****************************************************************************/ @@ -2292,6 +2305,7 @@ CTDL_MODULE_INIT(room_ops) CtdlRegisterProtoHook(cmd_lzrm, "LZRM", "List zapped rooms"); CtdlRegisterProtoHook(cmd_lprm, "LPRM", "List public rooms"); CtdlRegisterProtoHook(cmd_goto, "GOTO", "Goto a named room"); + CtdlRegisterProtoHook(cmd_stat, "STAT", "Get mtime of the current room"); CtdlRegisterProtoHook(cmd_whok, "WHOK", "List users who know this room"); CtdlRegisterProtoHook(cmd_rdir, "RDIR", "List files in room directory"); CtdlRegisterProtoHook(cmd_getr, "GETR", "Get room parameters"); -- 2.30.2