* Fixed .AM and .AE commands
authorArt Cancro <ajc@citadel.org>
Fri, 1 Nov 2002 04:57:57 +0000 (04:57 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 1 Nov 2002 04:57:57 +0000 (04:57 +0000)
citadel/ChangeLog
citadel/citadel.c
citadel/messages.c
citadel/messages.h
citadel/rooms.c
citadel/rooms.h

index 0a9e71343722b310487ed47043017c28cfd910a7..f63089d64f66ac24eafc6d343462457741b67c6e 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index db32e9259eefc706db51d2bfd65bebc3e4e390ec..a2c6fb5f88063c8d82864457f51b56ee9db38d2c 100644 (file)
@@ -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:
index 34751004490381f12d99f35cf16475700e061e26..4f28119005a90a548b0254da6246300229df6b61 100644 (file)
@@ -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);
 }
 
 
index 0f65e744c14679dad1ee4af8dc781a541467649d..c328a878b4fc8fbfa9f822e079e3a742ff539a8b 100644 (file)
@@ -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);
index e6e3e8fda4a1d84e338e34837057125637087317..dafb2af2243b1dd24815d61d418bcb83d14851db 100644 (file)
@@ -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)
index 7e53bb20d4dee52a4eb6ca05c7f5d32456192eca..834968f0659c31bbdca6f756d47e32c7695e6e87 100644 (file)
@@ -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);
+
 
 
 /*