AmendHub

Download:

jcs

/

subtext

/

amendments

/

441

board: Prepend 'Re: ' to all FTN reply subjects not having it


jcs made amendment 441 about 1 year ago
--- board.c Thu Mar 23 10:22:23 2023 +++ board.c Thu Mar 23 11:04:34 2023 @@ -460,12 +460,14 @@ board_list_posts(struct session *s, struct board *boar strftime(time, sizeof(time), "%b %d", localtime(&fpost.time)); - session_printf(s, "%s%2ld %c %s %-10.10s {{#}}%.50s%s\r\n", + session_printf(s, "%s%2ld %c %s {{#}}%-10.10s %s%.50s%s\r\n", true ? "" : ansi(s, ANSI_BOLD, ANSI_END), n + 1, true ? ' ' : 'N', time, fpost.from, + (fpost.reply[0] && strncasecmp(fpost.subject, "Re:", 3) != 0 ? + "Re: " : ""), fpost.subject, true ? "" : ansi(s, ANSI_RESET, ANSI_END)); } else { @@ -785,14 +787,15 @@ board_post_read(struct session *s, struct board *board strftime(time, sizeof(time), "%Y-%m-%d %H:%M:%S", localtime(&fpost.time)); - session_printf(s, "{{B}}From:{{/B}} %s\r\n", fpost.from); - session_printf(s, "{{B}}Origin:{{/B}} %s\r\n", fpost.origin); - session_printf(s, "{{B}}To:{{/B}} %s@%s\r\n", fpost.to, + session_printf(s, "{{B}}From:{{/B}}{{#}} %s\r\n", fpost.from); + session_printf(s, "{{B}}Origin:{{/B}}{{#}} %s\r\n", fpost.origin); + session_printf(s, "{{B}}To:{{/B}}{{#}} %s@%s\r\n", fpost.to, board->name); - session_printf(s, "{{B}}Date:{{/B}} %s %s\r\n", time, + session_printf(s, "{{B}}Date:{{/B}}{{#}} %s %s\r\n", time, db->config.timezone); - session_printf(s, "{{B}}Subject:{{/B}}{{#}} %s\r\n", - fpost.subject); + session_printf(s, "{{B}}Subject:{{/B}}{{#}} %s%s\r\n", + (fpost.reply[0] && strncasecmp(fpost.subject, "Re:", 3) != 0 ? + "Re: " : ""), fpost.subject); session_flush(s); session_printf(s, "\r\n"); session_output(s, fpost.body, fpost.body_size); @@ -830,13 +833,13 @@ board_post_read(struct session *s, struct board *board strftime(time, sizeof(time), "%Y-%m-%d %H:%M:%S", localtime(&post.time)); - session_printf(s, "{{B}}From:{{/B}} %s", + session_printf(s, "{{B}}From:{{/B}}{{#}} %s", sender ? sender->username : "(unknown)"); if (post.via[0]) session_printf(s, " (via %s)", post.via); session_printf(s, "\r\n"); - session_printf(s, "{{B}}To:{{/B}} %s\r\n", board->name); - session_printf(s, "{{B}}Date:{{/B}} %s %s\r\n", time, + session_printf(s, "{{B}}To:{{/B}}{{#}} %s\r\n", board->name); + session_printf(s, "{{B}}Date:{{/B}}{{#}} %s %s\r\n", time, db->config.timezone); session_printf(s, "{{B}}Subject:{{/B}}{{#}} %s%s\r\n", (post.parent_post_id ? "Re: " : ""), thread.subject);