From 86167c1a4d5481afb891f0605e2053cb234ed5df Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Fri, 22 Apr 2016 22:04:03 +1000 Subject: [PATCH] add another suggestion from avon --- mail_menu.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/mail_menu.c b/mail_menu.c index d27db2d..e08186c 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -1186,7 +1186,7 @@ int mail_menu(int socket, struct user_record *user) { int i; int j; int z; - + int k; struct msg_headers *msghs; s_JamBase *jb; @@ -1526,13 +1526,22 @@ int mail_menu(int socket, struct user_record *user) { jlr.LastReadMsg = 0; jlr.HighReadMsg = 0; } - sprintf(buffer, "Start at message [0-%d] ? ", msghs->msg_count - 1); + sprintf(buffer, "Start at message [0-%d] or N for New? ", msghs->msg_count - 1); s_putstring(socket, buffer); s_readstring(socket, buffer, 6); - i = atoi(buffer); - if (i < 0) { - i = 0; + if (tolower(buffer[0]) == 'n') { + k = jlr.HighReadMsg; + for (i=0;imsg_count;i++) { + if (msghs->msgs[i]->msg_no == k) { + break; + } + } + } else { + i = atoi(buffer); + if (i < 0) { + i = 0; + } } closed = 0; s_putstring(socket, "\e[2J\e[1;37;44m[MSG#] Subject From To Date \r\n\e[0m");