* commands.c: fixups to print_express() to make external command not print
authorMichael Hampton <io_error@uncensored.citadel.org>
Mon, 27 Nov 2000 14:12:09 +0000 (14:12 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Mon, 27 Nov 2000 14:12:09 +0000 (14:12 +0000)
  extraneous stuff to the terminal and make the displayed message consistent

citadel/ChangeLog
citadel/commands.c

index 768079dbb4516f83c65e099229e27e963fd4b485..1c087f6826b14cae8a733239c3e1569ac787240d 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 573.34  2000/11/27 14:12:09  error
+ * commands.c: fixups to print_express() to make external command not print
+   extraneous stuff to the terminal and make the displayed message consistent
+
  Revision 573.33  2000/11/27 10:41:14  error
  * print_express(): now uses GEXP instead of old PEXP; displays timestamps
 
@@ -2162,4 +2166,3 @@ 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 874680deb1138f63735ec2262691c419ee19a7e7..9e67b98817a03458281d764a29252a2e10a8262e 100644 (file)
@@ -196,8 +196,10 @@ void print_express(void)
        if (rc_exp_beep) {
                putc(7, stdout);
        }
-       color(BRIGHT_RED);
-       printf("\r---");
+       if (strlen(rc_exp_cmd) == 0) {
+               color(BRIGHT_RED);
+               printf("\r---");
+       }
        
        while (express_msgs != 0) {
                serv_puts("GEXP");
@@ -226,15 +228,29 @@ void print_express(void)
                                        fprintf(outpipe, "Chat request ");
                                else
                                        fprintf(outpipe, "Message ");
-                               /* 24hr format.  Can be changed, I guess. */
-                               fprintf(outpipe, "at %d:%02d from %s @%s:\n",
-                                       stamp->tm_hour, stamp->tm_min,
-                                       sender, node);
+                               /* Timestamp.  Can this be improved? */
+                               if (stamp->tm_hour == 0 || stamp->tm_hour == 12)
+                                       fprintf(outpipe, "at 12:%02d%cm",
+                                               stamp->tm_min, 
+                                               stamp->tm_hour ? 'p' : 'a');
+                               else if (stamp->tm_hour > 12)           /* pm */
+                                       fprintf(outpipe, "at %d:%02dpm",
+                                               stamp->tm_hour - 12,
+                                               stamp->tm_min);
+                               else                                    /* am */
+                                       fprintf(outpipe, "at %d:%02dam",
+                                               stamp->tm_hour, stamp->tm_min);
+                               fprintf(outpipe, " from %s", sender);
+                               if (strncmp(serv_info.serv_nodename, node, 32))
+                                       fprintf(outpipe, " @%s", node);
+                               fprintf(outpipe, ":\n");
                                while (serv_gets(buf), strcmp(buf, "000")) {
                                        fprintf(outpipe, "%s\n", buf);
                                }
                                pclose(outpipe);
-                               return;
+                               if (express_msgs == 0)
+                                       return;
+                               continue;
                        }
                }
                /* fall back to built-in express message display */