misc last read fixes

This commit is contained in:
Andrew Pamment 2016-08-21 09:29:58 +10:00
parent ef6d4b3ec2
commit 5861947e2a
2 changed files with 4 additions and 4 deletions

View File

@ -776,7 +776,7 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
jlr.HighReadMsg = msghs->msgs[mailno]->msg_no; jlr.HighReadMsg = msghs->msgs[mailno]->msg_no;
} }
jlr.LastReadMsg = mailno; jlr.LastReadMsg = msghs->msgs[mailno]->msg_no;
if (jlr.HighReadMsg < msghs->msgs[mailno]->msg_no) { if (jlr.HighReadMsg < msghs->msgs[mailno]->msg_no) {
jlr.HighReadMsg = msghs->msgs[mailno]->msg_no; jlr.HighReadMsg = msghs->msgs[mailno]->msg_no;
} }

View File

@ -364,12 +364,12 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
if (JAM_ReadLastRead(jb, user->id, &jlr) == JAM_NO_USER) { if (JAM_ReadLastRead(jb, user->id, &jlr) == JAM_NO_USER) {
jlr.UserCRC = JAM_Crc32(user->loginname, strlen(user->loginname)); jlr.UserCRC = JAM_Crc32(user->loginname, strlen(user->loginname));
jlr.UserID = user->id; jlr.UserID = user->id;
jlr.HighReadMsg = msg; jlr.HighReadMsg = msg - 1;
} }
jlr.LastReadMsg = msg; jlr.LastReadMsg = msg - 1;
if (jlr.HighReadMsg < msg) { if (jlr.HighReadMsg < msg) {
jlr.HighReadMsg = msg; jlr.HighReadMsg = msg - 1;
} }
JAM_WriteLastRead(jb, user->id, &jlr); JAM_WriteLastRead(jb, user->id, &jlr);