Fiddling with unread messages

This commit is contained in:
Andrew Pamment 2018-07-31 10:42:56 +10:00
parent e5a07a3a25
commit 1b661f4f5b

View File

@ -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);