зеркало из https://github.com/mozilla/pjs.git
fix 277905 problems handling imap uid with high bit set, patch by roger@eyesopen.com, r/sr=bienvenu
This commit is contained in:
Родитель
0686c4a2c3
Коммит
914db2d045
|
@ -1991,9 +1991,9 @@ nsImapMailFolder::AllocateUidStringFromKeys(nsMsgKey *keys, PRUint32 numKeys, ns
|
|||
}
|
||||
else if (curSequenceEnd > startSequence)
|
||||
{
|
||||
msgIds.AppendInt(startSequence);
|
||||
AppendUid(msgIds, startSequence);
|
||||
msgIds += ':';
|
||||
msgIds.AppendInt(curSequenceEnd);
|
||||
AppendUid(msgIds,curSequenceEnd);
|
||||
if (!lastKey)
|
||||
msgIds += ',';
|
||||
startSequence = nextKey;
|
||||
|
@ -2003,7 +2003,7 @@ nsImapMailFolder::AllocateUidStringFromKeys(nsMsgKey *keys, PRUint32 numKeys, ns
|
|||
{
|
||||
startSequence = nextKey;
|
||||
curSequenceEnd = startSequence;
|
||||
msgIds.AppendInt(keys[keyIndex]);
|
||||
AppendUid(msgIds, keys[keyIndex]);
|
||||
if (!lastKey)
|
||||
msgIds += ',';
|
||||
}
|
||||
|
|
|
@ -3653,7 +3653,7 @@ void nsImapProtocol::ProcessMailboxUpdate(PRBool handlePossibleUndo)
|
|||
}
|
||||
else
|
||||
{
|
||||
fetchStr.AppendInt(GetServerStateParser().HighestRecordedUID() + 1);
|
||||
AppendUid(fetchStr, GetServerStateParser().HighestRecordedUID() + 1);
|
||||
fetchStr.Append(":*");
|
||||
|
||||
// sprintf(fetchStr, "%ld:*", GetServerStateParser().HighestRecordedUID() + 1);
|
||||
|
@ -3904,7 +3904,7 @@ void nsImapProtocol::PeriodicBiff()
|
|||
id = 1;
|
||||
|
||||
//sprintf(fetchStr, "%ld:%ld", id, id + GetServerStateParser().NumberOfMessages() - fFlagState->GetNumberOfMessages());
|
||||
fetchStr.AppendInt(id);
|
||||
AppendUid(fetchStr, id);
|
||||
fetchStr.Append(":*");
|
||||
FetchMessage(fetchStr, kFlags, PR_TRUE);
|
||||
if (((PRUint32) m_flagState->GetHighestNonDeletedUID() >= id) && m_flagState->IsLastMessageUnseen())
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsReadableUtils.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "prsystem.h"
|
||||
#include "prprf.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsNetCID.h"
|
||||
|
||||
|
@ -452,3 +453,10 @@ void ParseUidString(const char *uidString, nsMsgKeyArray &keys)
|
|||
}
|
||||
}
|
||||
|
||||
void AppendUid(nsCString &msgIds, PRUint32 uid)
|
||||
{
|
||||
char buf[20];
|
||||
PR_snprintf(buf, sizeof(buf), "%u", uid);
|
||||
msgIds.Append(buf);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ nsCreateImapBaseMessageURI(const nsACString& baseURI, nsCString& baseMessageURI)
|
|||
|
||||
void AllocateImapUidString(PRUint32 *msgUids, PRUint32 &msgCount, nsImapFlagAndUidState *flagState, nsCString &returnString);
|
||||
void ParseUidString(const char *uidString, nsMsgKeyArray &keys);
|
||||
void AppendUid(nsCString &msgIds, PRUint32 uid);
|
||||
|
||||
|
||||
class nsImapMailboxSpec : public nsIMailboxSpec
|
||||
|
|
Загрузка…
Ссылка в новой задаче