From b9c294175ac4f92f5341eec7b103d8675cc5fa2f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 16 Aug 2002 21:04:57 +0000 Subject: [PATCH] * Add LPRM command --- citadel/ChangeLog | 4 +++- citadel/citserver.c | 4 ++++ citadel/room_ops.c | 26 ++++++++++++++++++++++++++ citadel/room_ops.h | 1 + citadel/techdoc/session.txt | 7 +++++++ 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 0f32fc0aa..33ee1adaa 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 591.94 2002/08/16 21:04:56 ajc + * Add LPRM command + Revision 591.93 2002/08/14 20:21:52 ajc * Extend GETR/SETR to allow twiddling of bits in the QRflags2 bucket * New flag and config options to allow/disallow self-service list subscription @@ -3909,4 +3912,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citserver.c b/citadel/citserver.c index 7785c73cb..42201f7bb 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -987,6 +987,10 @@ void do_command_loop(void) { cmd_lzrm(&cmdbuf[5]); } + else if (!strncasecmp(cmdbuf,"LPRM",4)) { + cmd_lprm(&cmdbuf[5]); + } + else if (!strncasecmp(cmdbuf,"GETU",4)) { cmd_getu(); } diff --git a/citadel/room_ops.c b/citadel/room_ops.c index eb80025e8..aab6583e1 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -576,6 +576,32 @@ void cmd_lkra(char *argbuf) +void cmd_lprm_backend(struct quickroom *qrbuf, void *data) +{ + int FloorBeingSearched = (-1); + FloorBeingSearched = *(int *)data; + + if ( ((qrbuf->QRflags & QR_PRIVATE) == 0) + && ((qrbuf->QRflags & QR_MAILBOX) == 0) + && ((qrbuf->QRfloor == (FloorBeingSearched)) + || ((FloorBeingSearched) < 0))) + list_roomname(qrbuf); +} + +void cmd_lprm(char *argbuf) +{ + int FloorBeingSearched = (-1); + if (strlen(argbuf) > 0) + FloorBeingSearched = extract_int(argbuf, 0); + + cprintf("%d Publiic rooms:\n", LISTING_FOLLOWS); + + ForEachRoom(cmd_lprm_backend, &FloorBeingSearched); + cprintf("000\n"); +} + + + /* * cmd_lkrn() - List all known rooms with new messages */ diff --git a/citadel/room_ops.h b/citadel/room_ops.h index 5bf963463..ea065314b 100644 --- a/citadel/room_ops.h +++ b/citadel/room_ops.h @@ -22,6 +22,7 @@ void cmd_lkra (char *argbuf); void cmd_lkrn (char *argbuf); void cmd_lkro (char *argbuf); void cmd_lzrm (char *argbuf); +void cmd_lprm (char *argbuf); void usergoto (char *where, int display_result, int transiently, int *msgs, int *new); void cmd_goto (char *gargs); diff --git a/citadel/techdoc/session.txt b/citadel/techdoc/session.txt index 7fabd9f9b..e0a752183 100644 --- a/citadel/techdoc/session.txt +++ b/citadel/techdoc/session.txt @@ -284,6 +284,13 @@ forgotten, with and without new messages. It does not, however, list inaccessible private rooms. + LPRM (List all Public RooMs) + + Again, same format. This command lists all public rooms, and nothing else. +Unlike the other list rooms commands, this one can be executed without logging +in. + + GETU (GET User configuration) This command retrieves the screen dimensions and user options for the -- 2.39.2