From 1b661f4f5b14894ce87e63234516ba13b906f28e Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Tue, 31 Jul 2018 10:42:56 +1000 Subject: [PATCH] Fiddling with unread messages --- src/mail_menu.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/mail_menu.c b/src/mail_menu.c index 5c575e3..d683c67 100644 --- a/src/mail_menu.c +++ b/src/mail_menu.c @@ -3587,32 +3587,22 @@ int new_messages(struct user_record *user, int conference, int area) { free(jb); return 0; } - if (conf.mail_conferences[conference]->mail_areas[area]->type == TYPE_NETMAIL_AREA) { - msghs = read_message_headers(conference, area, user, 0); - if (msghs != NULL) { - if (msghs->msg_count > 0) { - count = msghs->msg_count; - } - free_message_headers(msghs); + msghs = read_message_headers(conference, area, user, 0); + if (msghs != NULL) { + if (msghs->msg_count > 0) { + count = msghs->msg_count; } - } else { - count = jbh.ActiveMsgs; + free_message_headers(msghs); } } else { - if (jlr.HighReadMsg < jbh.ActiveMsgs) { - if (conf.mail_conferences[conference]->mail_areas[area]->type == TYPE_NETMAIL_AREA) { - msghs = read_message_headers(conference, area, user, 0); - if (msghs != NULL) { - if (msghs->msg_count > 0) { - if (msghs->msgs[msghs->msg_count-1]->msg_h->MsgNum > jlr.HighReadMsg) { - count = msghs->msgs[msghs->msg_count-1]->msg_h->MsgNum - jlr.HighReadMsg; - } - } - free_message_headers(msghs); + msghs = read_message_headers(conference, area, user, 0); + if (msghs != NULL) { + if (msghs->msg_count > 0) { + if (msghs->msgs[msghs->msg_count-1]->msg_h->MsgNum > jlr.HighReadMsg) { + count = msghs->msgs[msghs->msg_count-1]->msg_h->MsgNum - jlr.HighReadMsg; } - } else { - count = jbh.ActiveMsgs - jlr.HighReadMsg; } + free_message_headers(msghs); } } JAM_CloseMB(jb);