X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=textclient%2Fmessages.c;h=447c3922567378a14473de3596961cc99c002183;hb=8933df1f26595cfa3d9bb77f9b5a18d6b806d159;hp=cb5e4dd1b2afd17615f87a2bd096f6e35356ee96;hpb=a6722156441811d3cddce7179eb56c483eebd37f;p=citadel.git diff --git a/textclient/messages.c b/textclient/messages.c index cb5e4dd1b..447c39225 100644 --- a/textclient/messages.c +++ b/textclient/messages.c @@ -1,7 +1,7 @@ /* * Text client functions for reading and writing of messages * - * Copyright (c) 1987-2019 by the citadel.org team + * Copyright (c) 1987-2020 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -390,10 +390,11 @@ void mini_2047_decode(char *s) /* * Read a message from the server */ -int read_message(CtdlIPC * ipc, long num, /* message number */ - int pagin, /* 0 = normal read, 1 = read with pagination, 2 = header */ - FILE * dest) -{ /* Destination file, NULL for screen */ +int read_message(CtdlIPC *ipc, + long num, /* message number */ + int pagin, /* 0 = normal read, 1 = read with pagination, 2 = header */ + FILE *dest /* Destination file, NULL for screen */ +) { char buf[SIZ]; char now[256]; int format_type = 0; @@ -409,7 +410,6 @@ int read_message(CtdlIPC * ipc, long num, /* message number */ char ch; int linelen; int final_line_is_blank = 0; - has_images = 0; sigcaught = 0; @@ -432,7 +432,8 @@ int read_message(CtdlIPC * ipc, long num, /* message number */ if (dest) { fprintf(dest, "\n "); - } else { + } + else { scr_printf("\n"); if (pagin != 2) { scr_printf(" "); @@ -452,8 +453,7 @@ int read_message(CtdlIPC * ipc, long num, /* message number */ if (!IsEmptyStr(message->email)) { scr_printf("rfca=%s\n", message->email); } - scr_printf("room=%s\ntime=%s", message->room, asctime(localtime(&message->time)) - ); + scr_printf("room=%s\ntime=%s", message->room, asctime(localtime(&message->time))); if (!IsEmptyStr(message->recipient)) { scr_printf("rcpt=%s\n", message->recipient); } @@ -488,26 +488,29 @@ int read_message(CtdlIPC * ipc, long num, /* message number */ if (nhdr == 1 && !is_room_aide) { if (dest) { fprintf(dest, " ****"); - } else { + } + else { scr_printf(" ****"); } - } else { + } + else { struct tm thetime; localtime_r(&message->time, &thetime); strftime(now, sizeof now, "%F %R", &thetime); if (dest) { fprintf(dest, "%s from %s ", now, message->author); - if (!IsEmptyStr(message->email)) { + if (!message->is_local) { fprintf(dest, "<%s> ", message->email); } - } else { + } + else { color(BRIGHT_CYAN); scr_printf("%s ", now); color(DIM_WHITE); scr_printf("from "); color(BRIGHT_CYAN); scr_printf("%s ", message->author); - if (!IsEmptyStr(message->email)) { + if (!message->is_local) { color(DIM_WHITE); scr_printf("<"); color(BRIGHT_BLUE);