Fix for when a user only has 1 new message to them
This commit is contained in:
parent
ab91db2efa
commit
ef4453b77b
@ -244,29 +244,30 @@ PageFrame.prototype.loadMessage = function(page) {
|
||||
// if this message is to the user, and the msg number > scan_ptr and it is the next message on the user's new mail list
|
||||
var newmsgs = area.newMsgsToMe();
|
||||
var next;
|
||||
log(LOG_DEBUG,'User has: '+newmsgs.length+' msgs to read to ME');
|
||||
log(LOG_DEBUG,'User has: '+newmsgs.length-1+' msgs to read to ME');
|
||||
if (newmsgs.length) {
|
||||
next = newmsgs[1];
|
||||
log(LOG_DEBUG,'- NEXT is: '+next.tags+', this is: '+msg.tags);
|
||||
//log(LOG_DEBUG,'- NEXT is: '+next.tags+', this is: '+msg.tags);
|
||||
|
||||
if (next.tags === msg.tags) {
|
||||
if (next && (next.tags === msg.tags)) {
|
||||
log(LOG_DEBUG,'- Updating scan_ptr to: '+next.number);
|
||||
stats.scan_ptr = next.number;
|
||||
}
|
||||
|
||||
// Last message
|
||||
next = newmsgs[0];
|
||||
log(LOG_DEBUG,'- LAST TO ME is: '+next.tags);
|
||||
if (next !== undefined) {
|
||||
log(LOG_DEBUG,'- LAST TO ME is: '+next.tags);
|
||||
this.key[1] = area.page(next.tags);
|
||||
}
|
||||
|
||||
// Next new message
|
||||
next = newmsgs[2];
|
||||
if (next !== undefined) {
|
||||
log(LOG_DEBUG,'- NEXT TO ME is: '+next.tags);
|
||||
if (next !== undefined)
|
||||
this.key[2] = area.page(next.tags);
|
||||
}
|
||||
}
|
||||
|
||||
// if this message is the next message, update last_read
|
||||
newmsgs = area.newMsgs();
|
||||
|
Loading…
Reference in New Issue
Block a user