Minor bugfixes
authorArt Cancro <ajc@citadel.org>
Sun, 24 Jan 1999 05:40:26 +0000 (05:40 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 24 Jan 1999 05:40:26 +0000 (05:40 +0000)
citadel/client_chat.c
citadel/room_ops.c

index b1bdd58a12d01943872b658943cfb40d61960bea..16ec066d0b4b180016ebe359ec0fc9231ad1f611 100644 (file)
@@ -35,6 +35,7 @@
 extern struct CtdlServInfo serv_info;
 extern char temp[];
 void citedit(FILE *fp, long int base_pos);
+void getline(char *, int);
 
 void chatmode(void) {
        char wbuf[256];
@@ -198,7 +199,8 @@ RCL:            if (send_complete_line) {
 void page_user() {
        static char last_paged[32] = "";
        char buf[256], touser[256], msg[256];
-       FILE *fp;
+       char longmsg[5][80];
+       int i;
 
        strcpy(touser, last_paged);
        strprompt("Page who", touser, 30);
@@ -225,30 +227,28 @@ void page_user() {
                        printf("%s\n", &buf[4]);
                        return;
                        }
-               fp = fopen(temp, "w");
-               fp = freopen(temp, "rb+", fp);
-               if (fp==NULL) printf("Error: %s\n", strerror(errno));
-               unlink(temp);
+
                printf("Type message to send.  Enter a blank line when finished.\n");
-               citedit(fp, 0);
+               bzero(longmsg, sizeof longmsg);
+               for (i=0; i<5; ++i) {
+                       printf("> ");
+                       getline(&longmsg[i][0], 77);
+                       if (strlen(&longmsg[i][0])==0) i=5;
+                       }
                snprintf(buf, sizeof buf, "SEXP %s|-", touser);
                serv_puts(buf);
                serv_gets(buf);
                if (buf[0]=='4') {
                        strcpy(last_paged, touser);
-                       rewind(fp);
-                       while (fgets(buf, sizeof buf, fp) != NULL) {
-                               buf[strlen(buf)-1] = 0;
-                               if (strcmp(buf, "000")) serv_puts(buf);
-                       unlink(temp);
-                       }
+                       for (i=0; i<5; ++i)
+                               if (strlen(&longmsg[i][0])>0)
+                                       serv_puts(&longmsg[i][0]);
                        serv_puts("000");
                        printf("Message sent.\n");
                }
                else {
                        printf("%s\n", &buf[4]);
                }
-               fclose(fp);
        }
 }
 
index e333edb23bbe73e2bc51ceef32d1b16cb3eb7450..b48f8244e2a18728589ccd653f56bc4ffb2c7e40 100644 (file)
@@ -998,9 +998,11 @@ void cmd_setr(char *args) {
                        }
                }
 
-       new_order = extract_int(args, 6);
-       if (new_order < 1) new_order = 1;
-       if (new_order > 127) new_order = 127;
+       if (num_parms(args)>=7) {
+               new_order = extract_int(args, 6);
+               if (new_order < 1) new_order = 1;
+               if (new_order > 127) new_order = 127;
+               }
 
        lgetroom(&CC->quickroom, CC->quickroom.QRname);
        strcpy(old_name, CC->quickroom.QRname);
@@ -1011,7 +1013,8 @@ void cmd_setr(char *args) {
        extract(buf,args,2); buf[15]=0;
        strncpy(CC->quickroom.QRdirname,buf,19);
        CC->quickroom.QRflags = ( extract_int(args,3) | QR_INUSE);
-       CC->quickroom.QRorder = (char)new_order;
+       if (num_parms(args)>=7)
+               CC->quickroom.QRorder = (char)new_order;
 
        /* Clean up a client boo-boo: if the client set the room to
         * guess-name or passworded, ensure that the private flag is