diff --git a/STRINGS.CHANGES b/STRINGS.CHANGES index 39a3c32..5484a9e 100644 --- a/STRINGS.CHANGES +++ b/STRINGS.CHANGES @@ -23,6 +23,18 @@ LINE: 277 NEW OLDSTRING: (NONE) NEWSTRING: "\r\nScan for new personal mail? (Y/N/S): " +LINE: 278 NEW +OLDSTRING: (NONE) +NEWSTRING: "\e[1;32mConference: \e[1;37m%d. %s\e[0m\r\n" + +LINE: 279 NEW +OLDSTRING: (NONE) +NEWSTRING: "\e[1;32m Area: \e[1;37m%d. %s \e[1;33m(%d New Messages)\e[0m\r\n\r\n" + +LINE: 280 NEW +OLDSTRING: (NONE) +NEWSTRING: "Read Now ? (Y / N): " + Changes from v0.8-alpha -> v0.9-alpha -------------------------------------------------------------- LINE: 255 NEW diff --git a/dist/magicka.strings b/dist/magicka.strings index 9f8593d..356fc3a 100644 --- a/dist/magicka.strings +++ b/dist/magicka.strings @@ -275,3 +275,6 @@ File exists!\r\n \r\n\e[1;31mError executing archiver.\r\n\e[0m \r\n\r\n\e[1;37m(\e[1;32mV\e[1;37m)iew or \e[1;37m(\e[1;32mU\e[1;37m)pdate Automessage or \e[1;37m(\e[1;31mQ\e[1;37m)uit: \e[0m \r\nScan for new personal mail? (Y/N/S): +\e[1;32mConference: \e[1;37m%d. %s\e[0m\r\n +\e[1;32m Area: \e[1;37m%d. %s \e[1;33m(%d New Messages)\e[0m\r\n\r\n +Read Now ? (Y / N): diff --git a/src/mail_menu.c b/src/mail_menu.c index 692555e..eddea47 100644 --- a/src/mail_menu.c +++ b/src/mail_menu.c @@ -1686,6 +1686,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno if (tolower(c) == 'r') { JAM_CloseMB(jb); free(jb); + jb = NULL; if (user->sec_level < conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->write_sec_level) { s_printf(get_string(113)); } else { @@ -1976,6 +1977,11 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno msg_line_count = 0; } + if (jb != NULL) { + JAM_CloseMB(jb); + free(jb); + } + if (doquit == 2) { return 1; } @@ -2004,7 +2010,8 @@ int read_new_msgs(struct user_record *user, struct msg_headers *msghs) { jlr.LastReadMsg = 0; jlr.HighReadMsg = 0; all_unread = 1; - } else if (jlr.LastReadMsg == 0 && jlr.HighReadMsg == 0) { + } + if (jlr.LastReadMsg == 0 && jlr.HighReadMsg == 0) { all_unread = 1; } JAM_CloseMB(jb); @@ -2013,10 +2020,15 @@ int read_new_msgs(struct user_record *user, struct msg_headers *msghs) { k = jlr.HighReadMsg; for (i=0;imsg_count;i++) { if (msghs->msgs[i]->msg_h->MsgNum == k) { + i+=2; break; } + if (msghs->msgs[i]->msg_h->MsgNum > k) { + i++; + break; + } } - i += 2; + } else { i = 1; } @@ -3001,6 +3013,9 @@ void do_mail_scan(struct user_record *user, int oldscan, int personal) { int orig_conf; int orig_area; int res = 0; + char ch; + int unread_count; + int k; if (personal) { s_printf(get_string(276)); @@ -3014,12 +3029,15 @@ void do_mail_scan(struct user_record *user, int oldscan, int personal) { if (conf.mail_conferences[i]->sec_level > user->sec_level) { continue; } - s_printf(get_string(140), i, conf.mail_conferences[i]->name); - lines+=2; - if (lines == 22) { - s_printf(get_string(6)); - s_getc(); - lines = 0; + if (oldscan) { + s_printf(get_string(140), i, conf.mail_conferences[i]->name); + + lines+=2; + if (lines == 22) { + s_printf(get_string(6)); + s_getc(); + lines = 0; + } } for (j=0;jmail_area_count;j++) { if (conf.mail_conferences[i]->mail_areas[j]->read_sec_level > user->sec_level) { @@ -3061,16 +3079,25 @@ void do_mail_scan(struct user_record *user, int oldscan, int personal) { lines = 0; } } else { - orig_conf = user->cur_mail_conf; - orig_area = user->cur_mail_area; - - user->cur_mail_conf = i; - user->cur_mail_area = j; - - res = read_new_msgs(user, msghs); - - user->cur_mail_conf = orig_conf; - user->cur_mail_area = orig_area; + s_printf("\e[2J\e[1;1H"); + s_printf(get_string(277), i, conf.mail_conferences[i]->name); + s_printf(get_string(278), j, conf.mail_conferences[i]->mail_areas[j]->name, msghs->msg_count); + s_printf(get_string(289)); + + ch = s_getchar(); + s_printf("\r\n"); + if (tolower(ch) == 'y') { + orig_conf = user->cur_mail_conf; + orig_area = user->cur_mail_area; + + user->cur_mail_conf = i; + user->cur_mail_area = j; + + res = read_new_msgs(user, msghs); + + user->cur_mail_conf = orig_conf; + user->cur_mail_area = orig_area; + } } } free_message_headers(msghs); @@ -3087,17 +3114,27 @@ void do_mail_scan(struct user_record *user, int oldscan, int personal) { } else { msghs = read_message_headers(i, j, user, personal); if (msghs != NULL) { - if (msghs->msg_count > 0) { - orig_conf = user->cur_mail_conf; - orig_area = user->cur_mail_area; - - user->cur_mail_conf = i; - user->cur_mail_area = j; - - res = read_new_msgs(user, msghs); - - user->cur_mail_conf = orig_conf; - user->cur_mail_area = orig_area; + + if (msghs->msg_count > 0) { + s_printf("\e[2J\e[1;1H"); + s_printf(get_string(277), i, conf.mail_conferences[i]->name); + s_printf(get_string(278), j, conf.mail_conferences[i]->mail_areas[j]->name, msghs->msg_count); + s_printf(get_string(289)); + + ch = s_getchar(); + s_printf("\r\n"); + if (tolower(ch) == 'y') { + orig_conf = user->cur_mail_conf; + orig_area = user->cur_mail_area; + + user->cur_mail_conf = i; + user->cur_mail_area = j; + + res = read_new_msgs(user, msghs); + + user->cur_mail_conf = orig_conf; + user->cur_mail_area = orig_area; + } } free_message_headers(msghs); } @@ -3105,13 +3142,24 @@ void do_mail_scan(struct user_record *user, int oldscan, int personal) { } } else { if (jlr.HighReadMsg < jbh.ActiveMsgs) { + + + if (conf.mail_conferences[i]->mail_areas[j]->type == TYPE_NETMAIL_AREA) { msghs = read_message_headers(i, j, user, personal); if (msghs != NULL) { if (msghs->msg_count > 0) { + unread_count = 0; + + for (k=msghs->msg_count-1;k>=0;k--) { + if (msghs->msgs[k]->msg_no <= jlr.HighReadMsg) { + break; + } + unread_count++; + } if (msghs->msgs[msghs->msg_count-1]->msg_no > jlr.HighReadMsg) { if (oldscan) { - s_printf(get_string(141), j, conf.mail_conferences[i]->mail_areas[j]->name, msghs->msgs[msghs->msg_count-1]->msg_h->MsgNum - jlr.HighReadMsg); + s_printf(get_string(141), j, conf.mail_conferences[i]->mail_areas[j]->name, unread_count); lines++; if (lines == 22) { s_printf(get_string(6)); @@ -3119,16 +3167,25 @@ void do_mail_scan(struct user_record *user, int oldscan, int personal) { lines = 0; } } else { - orig_conf = user->cur_mail_conf; - orig_area = user->cur_mail_area; - - user->cur_mail_conf = i; - user->cur_mail_area = j; - - res = read_new_msgs(user, msghs); - - user->cur_mail_conf = orig_conf; - user->cur_mail_area = orig_area; + s_printf("\e[2J\e[1;1H"); + s_printf(get_string(277), i, conf.mail_conferences[i]->name); + s_printf(get_string(278), j, conf.mail_conferences[i]->mail_areas[j]->name, unread_count); + s_printf(get_string(289)); + + ch = s_getchar(); + s_printf("\r\n"); + if (tolower(ch) == 'y') { + orig_conf = user->cur_mail_conf; + orig_area = user->cur_mail_area; + + user->cur_mail_conf = i; + user->cur_mail_area = j; + + res = read_new_msgs(user, msghs); + + user->cur_mail_conf = orig_conf; + user->cur_mail_area = orig_area; + } } } } @@ -3146,17 +3203,34 @@ void do_mail_scan(struct user_record *user, int oldscan, int personal) { } else { msghs = read_message_headers(i, j, user, personal); if (msghs != NULL) { - if (msghs->msg_count > 0) { - orig_conf = user->cur_mail_conf; - orig_area = user->cur_mail_area; - - user->cur_mail_conf = i; - user->cur_mail_area = j; - - res = read_new_msgs(user, msghs); - - user->cur_mail_conf = orig_conf; - user->cur_mail_area = orig_area; + if (msghs->msg_count > 0) { + unread_count = 0; + + for (k=msghs->msg_count-1;k>=0;k--) { + if (msghs->msgs[k]->msg_no <= jlr.HighReadMsg) { + break; + } + unread_count++; + } + s_printf("\e[2J\e[1;1H"); + s_printf(get_string(277), i, conf.mail_conferences[i]->name); + s_printf(get_string(278), j, conf.mail_conferences[i]->mail_areas[j]->name, unread_count); + s_printf(get_string(279)); + + ch = s_getchar(); + s_printf("\r\n"); + if (tolower(ch) == 'y') { + orig_conf = user->cur_mail_conf; + orig_area = user->cur_mail_area; + + user->cur_mail_conf = i; + user->cur_mail_area = j; + + res = read_new_msgs(user, msghs); + + user->cur_mail_conf = orig_conf; + user->cur_mail_area = orig_area; + } } free_message_headers(msghs); }