From: Art Cancro Date: Fri, 1 Nov 2002 04:57:57 +0000 (+0000) Subject: * Fixed .AM and .AE commands X-Git-Tag: v7.86~6140 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=a81b7d106169ed0e48573021cbc85ebcbcc3d10f;p=citadel.git * Fixed .AM and .AE commands --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 0a9e71343..f63089d64 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 601.55 2002/11/01 04:57:56 ajc + * Fixed .AM and .AE commands + Revision 601.54 2002/10/29 20:14:56 error * rooms.c: don't allow a blank floor name when creating a floor (in client) @@ -4171,3 +4174,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/citadel.c b/citadel/citadel.c index db32e9259..a2c6fb5f8 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -1666,7 +1666,7 @@ NEWUSR: if (strlen(rc_password) == 0) { break; case 70: - edit_system_message(argbuf); + edit_system_message(ipc, argbuf); break; case 19: diff --git a/citadel/messages.c b/citadel/messages.c index 347510044..4f2811900 100644 --- a/citadel/messages.c +++ b/citadel/messages.c @@ -59,7 +59,6 @@ void sttybbs(int cmd); int haschar(const char *st, int ch); void getline(char *string, int lim); int file_checksum(char *filename); -void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd); void progress(unsigned long curr, unsigned long cmax); unsigned long *msg_arr = NULL; @@ -1619,16 +1618,16 @@ RMSGREAD: scr_flush(); /* * View and edit a system message */ -void edit_system_message(char *which_message) +void edit_system_message(CtdlIPC *ipc, char *which_message) { - char desc[64]; - char read_cmd[64]; - char write_cmd[64]; + char desc[SIZ]; + char read_cmd[SIZ]; + char write_cmd[SIZ]; snprintf(desc, sizeof desc, "system message '%s'", which_message); snprintf(read_cmd, sizeof read_cmd, "MESG %s", which_message); snprintf(write_cmd, sizeof write_cmd, "EMSG %s", which_message); - do_edit(desc, read_cmd, "NOOP", write_cmd); + do_edit(ipc, desc, read_cmd, "NOOP", write_cmd); } diff --git a/citadel/messages.h b/citadel/messages.h index 0f65e744c..c328a878b 100644 --- a/citadel/messages.h +++ b/citadel/messages.h @@ -2,7 +2,7 @@ int ka_system(char *shc); int entmsg(CtdlIPC *ipc, int is_reply, int c); void readmsgs(CtdlIPC *ipc, int c, int rdir, int q); -void edit_system_message(char *which_message); +void edit_system_message(CtdlIPC *ipc, char *which_message); pid_t ka_wait(int *kstatus); void list_urls(CtdlIPC *ipc); void check_message_base(CtdlIPC *ipc); diff --git a/citadel/rooms.c b/citadel/rooms.c index e6e3e8fda..dafb2af22 100644 --- a/citadel/rooms.c +++ b/citadel/rooms.c @@ -338,6 +338,7 @@ int select_floor(CtdlIPC *ipc, int rfloor) newfloor = (-1); safestrncpy(floorstr, floorlist[rfloor], sizeof floorstr); + strprompt("Which floor", floorstr, 255); for (a = 0; a < 128; ++a) { if (!strcasecmp (floorstr, &floorlist[a][0])) @@ -365,6 +366,12 @@ int select_floor(CtdlIPC *ipc, int rfloor) } while (newfloor < 0); return (newfloor); } + + else { + scr_printf("Floor selection bypassed because you have " + "floor mode disabled.\n"); + } + return (rfloor); } @@ -409,6 +416,7 @@ void editthisroom(CtdlIPC *ipc) /* Now interact with the user. */ + strprompt("Room name", attr->QRname, ROOMNAMELEN-1); attr->QRfloor = select_floor(ipc, attr->QRfloor); attr->QRflags = set_room_attr(ipc, attr->QRflags, "Private room", QR_PRIVATE); if (attr->QRflags & QR_PRIVATE) { @@ -443,21 +451,28 @@ void editthisroom(CtdlIPC *ipc) rbump = boolprompt("Cause current users to forget room", 0); } - attr->QRflags = set_room_attr(ipc, attr->QRflags, "Preferred users only", QR_PREFONLY); - attr->QRflags = set_room_attr(ipc, attr->QRflags, "Read-only room", QR_READONLY); - attr->QRflags = set_room_attr(ipc, attr->QRflags, "Directory room", QR_DIRECTORY); - attr->QRflags = set_room_attr(ipc, attr->QRflags, "Permanent room", QR_PERMANENT); + attr->QRflags = set_room_attr(ipc, attr->QRflags, + "Preferred users only", QR_PREFONLY); + attr->QRflags = set_room_attr(ipc, attr->QRflags, + "Read-only room", QR_READONLY); + attr->QRflags = set_room_attr(ipc, attr->QRflags, + "Directory room", QR_DIRECTORY); + attr->QRflags = set_room_attr(ipc, attr->QRflags, + "Permanent room", QR_PERMANENT); if (attr->QRflags & QR_DIRECTORY) { strprompt("Directory name", attr->QRdirname, 14); attr->QRflags = - set_room_attr(ipc, attr->QRflags, "Uploading allowed", QR_UPLOAD); + set_room_attr(ipc, attr->QRflags, + "Uploading allowed", QR_UPLOAD); attr->QRflags = set_room_attr(ipc, attr->QRflags, "Downloading allowed", QR_DOWNLOAD); attr->QRflags = - set_room_attr(ipc, attr->QRflags, "Visible directory", QR_VISDIR); + set_room_attr(ipc, attr->QRflags, + "Visible directory", QR_VISDIR); } - attr->QRflags = set_room_attr(ipc, attr->QRflags, "Network shared room", QR_NETWORK); + attr->QRflags = set_room_attr(ipc, attr->QRflags, + "Network shared room", QR_NETWORK); attr->QRflags2 = set_room_attr(ipc, attr->QRflags2, "Self-service list subscribe/unsubscribe", QR2_SELFLIST); @@ -960,7 +975,6 @@ void do_edit(CtdlIPC *ipc, char cmd[SIZ]; int b, cksum, editor_exit; - if (strlen(editor_path) == 0) { scr_printf("Do you wish to re-enter %s? ", desc); if (yesno() == 0) diff --git a/citadel/rooms.h b/citadel/rooms.h index 7e53bb20d..834968f06 100644 --- a/citadel/rooms.h +++ b/citadel/rooms.h @@ -21,6 +21,9 @@ void enter_bio(CtdlIPC *ipc); void hit_any_key(void); int save_buffer(void *file, size_t filelen, const char *pathname); void destination_directory(char *dest, const char *supplied_filename); +void do_edit(CtdlIPC *ipc, + char *desc, char *read_cmd, char *check_cmd, char *write_cmd); + /*