From: Michael Hampton Date: Mon, 27 Nov 2000 14:12:09 +0000 (+0000) Subject: * commands.c: fixups to print_express() to make external command not print X-Git-Tag: v7.86~7037 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=5385a6f79be2f6675ee614e98de8115c41d13ce1;p=citadel.git * commands.c: fixups to print_express() to make external command not print extraneous stuff to the terminal and make the displayed message consistent --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 768079dbb..1c087f682 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/commands.c b/citadel/commands.c index 874680deb..9e67b9881 100644 --- a/citadel/commands.c +++ b/citadel/commands.c @@ -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 */