AmendHub

Download:

jcs

/

subtext

/

amendments

/

436

board: Show latest post date in FTN area list


jcs made amendment 436 about 1 year ago
--- board.c Wed Mar 15 22:41:05 2023 +++ board.c Fri Mar 17 15:39:54 2023 @@ -173,7 +173,7 @@ board_list_ftn_areas(struct session *s) struct board *fboards = NULL, tboard; struct fidopkt_address our_address; size_t nfboards; - char title[50]; + char title[50], latest[10]; char c; short an, n, i, j; bool done, show_list, show_help; @@ -223,13 +223,20 @@ board_list_ftn_areas(struct session *s) while (!done && !s->ending) { if (show_list) { session_printf(s, "{{B}}%s{{/B}}\r\n", title); - session_printf(s, "%s# Area Description%s\r\n", + session_printf(s, "%s # Latest Area Description%s\r\n", ansi(s, ANSI_BOLD, ANSI_END), ansi(s, ANSI_RESET, ANSI_END)); session_flush(s); for (n = 0; n < nfboards; n++) { - session_printf(s, "%2d %- 13.13s %s\r\n", + if (fboards[n].last_post_at) + strftime(latest, sizeof(latest), "%b %d", + localtime(&fboards[n].last_post_at)); + else + latest[0] = '\0'; + + session_printf(s, "%2d % 6s %- 13.13s %s\r\n", n + 1, + latest, fboards[n].ftn_area, fboards[n].description); } @@ -1192,7 +1199,10 @@ board_post_create(struct board *board, struct board_th } bile_flush(board->bile, true); - + + if (post->time > board->last_post_at) + board->last_post_at = post->time; + done: return (post->id == 0 ? -1 : 0); }