fix problem with imap messages arriving out of order, r=jefft,mscott 40701

This commit is contained in:
bienvenu%netscape.com 2000-06-27 23:52:05 +00:00
Родитель 2e71c24a0b
Коммит b9c1f9cd75
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -298,8 +298,15 @@ imapMessageFlagsType nsImapFlagAndUidState::GetMessageFlagsFromUID(PRUint32 uid,
lo = msgIndex + 1;
}
msgIndex = lo;
while ((msgIndex > 0) && (fUids[msgIndex] > (PRUint32) uid))
// leave msgIndex pointing to the first slot with a value > uid
// first, move it before any ids that are > (shouldn't happen).
while ((msgIndex > 0) && (fUids[msgIndex - 1] > (PRUint32) uid))
msgIndex--;
// next, move msgIndex up to the first slot > than uid.
while ((PRUint32) uid < fUids[msgIndex])
msgIndex++;
if (msgIndex < 0)
msgIndex = 0;
*ndx = msgIndex;

Просмотреть файл

@ -2482,7 +2482,7 @@ void nsImapMailFolder::FindKeysToAdd(const nsMsgKeyArray &existingKeys, nsMsgKey
imapMessageFlagsType flags;
flagState->GetMessageFlags(flagIndex, &flags);
if (showDeletedMessages || ! (flags & kImapMsgDeletedFlag))
if (uidOfMessage != nsMsgKey_None &&showDeletedMessages || ! (flags & kImapMsgDeletedFlag))
{
keysToFetch.Add(uidOfMessage);
}