зеркало из https://github.com/mozilla/pjs.git
fix problem with IMail imap server flag changes not persisting also fixed whitespace and replace PR_FREEIF with PR_Free r=cavin, sr=sspitzer 180001
This commit is contained in:
Родитель
38b3aff109
Коммит
0f226b185a
|
@ -1855,11 +1855,11 @@ static int PR_CALLBACK CompareKey (const void *v1, const void *v2, void *)
|
||||||
/* static */nsresult
|
/* static */nsresult
|
||||||
nsImapMailFolder::AllocateUidStringFromKeys(nsMsgKey *keys, PRInt32 numKeys, nsCString &msgIds)
|
nsImapMailFolder::AllocateUidStringFromKeys(nsMsgKey *keys, PRInt32 numKeys, nsCString &msgIds)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
PRInt32 startSequence = -1;
|
PRUint32 startSequence; // no need to init; we won't use it unless numKeys > 0
|
||||||
if (numKeys > 0)
|
if (numKeys > 0)
|
||||||
startSequence = keys[0];
|
startSequence = keys[0];
|
||||||
PRInt32 curSequenceEnd = startSequence;
|
PRUint32 curSequenceEnd = startSequence;
|
||||||
PRUint32 total = numKeys;
|
PRUint32 total = numKeys;
|
||||||
// sort keys and then generate ranges instead of singletons!
|
// sort keys and then generate ranges instead of singletons!
|
||||||
NS_QuickSort(keys, numKeys, sizeof(nsMsgKey), CompareKey, nsnull);
|
NS_QuickSort(keys, numKeys, sizeof(nsMsgKey), CompareKey, nsnull);
|
||||||
|
@ -1895,7 +1895,7 @@ nsImapMailFolder::AllocateUidStringFromKeys(nsMsgKey *keys, PRInt32 numKeys, nsC
|
||||||
msgIds += ',';
|
msgIds += ',';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsImapMailFolder::MarkMessagesImapDeleted(nsMsgKeyArray *keyArray, PRBool deleted, nsIMsgDatabase *db)
|
nsresult nsImapMailFolder::MarkMessagesImapDeleted(nsMsgKeyArray *keyArray, PRBool deleted, nsIMsgDatabase *db)
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -121,50 +121,50 @@ public:
|
||||||
// set this to false if you don't want to alert the user to server
|
// set this to false if you don't want to alert the user to server
|
||||||
// error messages
|
// error messages
|
||||||
void SetReportingErrors(PRBool reportThem) { fReportingErrors=reportThem;}
|
void SetReportingErrors(PRBool reportThem) { fReportingErrors=reportThem;}
|
||||||
PRBool GetReportingErrors() { return fReportingErrors; }
|
PRBool GetReportingErrors() { return fReportingErrors; }
|
||||||
|
|
||||||
PRUint32 GetCapabilityFlag() { return fCapabilityFlag; }
|
PRUint32 GetCapabilityFlag() { return fCapabilityFlag; }
|
||||||
void SetCapabilityFlag(PRUint32 capability) {fCapabilityFlag = capability;}
|
void SetCapabilityFlag(PRUint32 capability) {fCapabilityFlag = capability;}
|
||||||
PRBool ServerHasIMAP4Rev1Capability() { return ((fCapabilityFlag & kIMAP4rev1Capability) != 0); }
|
PRBool ServerHasIMAP4Rev1Capability() { return ((fCapabilityFlag & kIMAP4rev1Capability) != 0); }
|
||||||
PRBool ServerHasACLCapability() { return ((fCapabilityFlag & kACLCapability) != 0); }
|
PRBool ServerHasACLCapability() { return ((fCapabilityFlag & kACLCapability) != 0); }
|
||||||
PRBool ServerHasNamespaceCapability() { return ((fCapabilityFlag & kNamespaceCapability) != 0); }
|
PRBool ServerHasNamespaceCapability() { return ((fCapabilityFlag & kNamespaceCapability) != 0); }
|
||||||
PRBool ServerIsNetscape3xServer() { return fServerIsNetscape3xServer; }
|
PRBool ServerIsNetscape3xServer() { return fServerIsNetscape3xServer; }
|
||||||
PRBool ServerHasServerInfo() {return ((fCapabilityFlag & kXServerInfoCapability) != 0); }
|
PRBool ServerHasServerInfo() {return ((fCapabilityFlag & kXServerInfoCapability) != 0); }
|
||||||
PRBool ServerIsAOLServer() {return ((fCapabilityFlag & kAOLImapCapability) != 0); }
|
PRBool ServerIsAOLServer() {return ((fCapabilityFlag & kAOLImapCapability) != 0); }
|
||||||
void SetFetchingFlags(PRBool aFetchFlags) { fFetchingAllFlags = aFetchFlags;}
|
void SetFetchingFlags(PRBool aFetchFlags) { fFetchingAllFlags = aFetchFlags;}
|
||||||
void ResetCapabilityFlag() ;
|
void ResetCapabilityFlag() ;
|
||||||
|
|
||||||
const char *GetMailAccountUrl() { return fMailAccountUrl; }
|
const char *GetMailAccountUrl() { return fMailAccountUrl; }
|
||||||
const char *GetXSenderInfo() { return fXSenderInfo; }
|
const char *GetXSenderInfo() { return fXSenderInfo; }
|
||||||
void FreeXSenderInfo() { PR_FREEIF(fXSenderInfo); }
|
void FreeXSenderInfo() { PR_FREEIF(fXSenderInfo); }
|
||||||
const char *GetManageListsUrl() { return fManageListsUrl; }
|
const char *GetManageListsUrl() { return fManageListsUrl; }
|
||||||
const char *GetManageFiltersUrl() {return fManageFiltersUrl;}
|
const char *GetManageFiltersUrl() {return fManageFiltersUrl;}
|
||||||
const char *GetManageFolderUrl() {return fFolderAdminUrl;}
|
const char *GetManageFolderUrl() {return fFolderAdminUrl;}
|
||||||
|
|
||||||
|
|
||||||
// Call this when adding a pipelined command to the session
|
// Call this when adding a pipelined command to the session
|
||||||
void IncrementNumberOfTaggedResponsesExpected(const char *newExpectedTag);
|
void IncrementNumberOfTaggedResponsesExpected(const char *newExpectedTag);
|
||||||
|
|
||||||
// Interrupt a Fetch, without really Interrupting (through netlib)
|
// Interrupt a Fetch, without really Interrupting (through netlib)
|
||||||
PRBool GetLastFetchChunkReceived();
|
PRBool GetLastFetchChunkReceived();
|
||||||
void ClearLastFetchChunkReceived();
|
void ClearLastFetchChunkReceived();
|
||||||
virtual PRUint16 SupportsUserFlags() { return fSupportsUserDefinedFlags; };
|
virtual PRUint16 SupportsUserFlags() { return fSupportsUserDefinedFlags; };
|
||||||
virtual PRUint16 SettablePermanentFlags() { return fSettablePermanentFlags;};
|
virtual PRUint16 SettablePermanentFlags() { return fSettablePermanentFlags;};
|
||||||
void SetFlagState(nsIImapFlagAndUidState *state);
|
void SetFlagState(nsIImapFlagAndUidState *state);
|
||||||
|
|
||||||
PRBool GetDownloadingHeaders();
|
PRBool GetDownloadingHeaders();
|
||||||
PRBool GetFillingInShell();
|
PRBool GetFillingInShell();
|
||||||
void UseCachedShell(nsIMAPBodyShell *cachedShell);
|
void UseCachedShell(nsIMAPBodyShell *cachedShell);
|
||||||
void SetHostSessionList(nsIImapHostSessionList *aHostSession);
|
void SetHostSessionList(nsIImapHostSessionList *aHostSession);
|
||||||
nsIImapHostSessionList *GetHostSessionList();
|
nsIImapHostSessionList *GetHostSessionList();
|
||||||
char *fCRAMDigest; // the digest returned by the server in response to authenticate using CRAM-MD5...
|
char *fCRAMDigest; // the digest returned by the server in response to authenticate using CRAM-MD5...
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void flags();
|
virtual void flags();
|
||||||
virtual void envelope_data();
|
virtual void envelope_data();
|
||||||
virtual void xaolenvelope_data();
|
virtual void xaolenvelope_data();
|
||||||
virtual void parse_address(nsCAutoString &addressLine);
|
virtual void parse_address(nsCAutoString &addressLine);
|
||||||
virtual void internal_date();
|
virtual void internal_date();
|
||||||
virtual nsresult BeginMessageDownload(const char *content_type);
|
virtual nsresult BeginMessageDownload(const char *content_type);
|
||||||
|
|
||||||
virtual void response_data();
|
virtual void response_data();
|
||||||
|
@ -172,6 +172,7 @@ protected:
|
||||||
virtual void resp_cond_state();
|
virtual void resp_cond_state();
|
||||||
virtual void text_mime2();
|
virtual void text_mime2();
|
||||||
virtual void text();
|
virtual void text();
|
||||||
|
virtual void parse_folder_flags();
|
||||||
virtual void language_data();
|
virtual void language_data();
|
||||||
virtual void cramResponse_data();
|
virtual void cramResponse_data();
|
||||||
virtual void resp_text_code();
|
virtual void resp_text_code();
|
||||||
|
@ -182,18 +183,18 @@ protected:
|
||||||
virtual void mailbox_data();
|
virtual void mailbox_data();
|
||||||
virtual void numeric_mailbox_data();
|
virtual void numeric_mailbox_data();
|
||||||
virtual void capability_data();
|
virtual void capability_data();
|
||||||
virtual void xserverinfo_data();
|
virtual void xserverinfo_data();
|
||||||
virtual void xmailboxinfo_data();
|
virtual void xmailboxinfo_data();
|
||||||
virtual void namespace_data();
|
virtual void namespace_data();
|
||||||
virtual void myrights_data();
|
virtual void myrights_data();
|
||||||
virtual void acl_data();
|
virtual void acl_data();
|
||||||
virtual void bodystructure_data();
|
virtual void bodystructure_data();
|
||||||
virtual void mime_data();
|
virtual void mime_data();
|
||||||
virtual void mime_part_data();
|
virtual void mime_part_data();
|
||||||
virtual void mime_header_data();
|
virtual void mime_header_data();
|
||||||
virtual void msg_fetch();
|
virtual void msg_fetch();
|
||||||
virtual void msg_obsolete();
|
virtual void msg_obsolete();
|
||||||
virtual void msg_fetch_headers(const char *partNum);
|
virtual void msg_fetch_headers(const char *partNum);
|
||||||
virtual void msg_fetch_content(PRBool chunk, PRInt32 origin, const char *content_type);
|
virtual void msg_fetch_content(PRBool chunk, PRInt32 origin, const char *content_type);
|
||||||
virtual PRBool msg_fetch_quoted(PRBool chunk, PRInt32 origin);
|
virtual PRBool msg_fetch_quoted(PRBool chunk, PRInt32 origin);
|
||||||
virtual PRBool msg_fetch_literal(PRBool chunk, PRInt32 origin);
|
virtual PRBool msg_fetch_literal(PRBool chunk, PRInt32 origin);
|
||||||
|
@ -206,26 +207,35 @@ protected:
|
||||||
const char *currentCommand);
|
const char *currentCommand);
|
||||||
virtual void PostProcessEndOfLine();
|
virtual void PostProcessEndOfLine();
|
||||||
|
|
||||||
// Overridden from the nsIMAPGenericParser, to retrieve the next line
|
// Overridden from the nsIMAPGenericParser, to retrieve the next line
|
||||||
// from the open socket.
|
// from the open socket.
|
||||||
virtual PRBool GetNextLineForParser(char **nextLine);
|
virtual PRBool GetNextLineForParser(char **nextLine);
|
||||||
virtual void end_of_line();
|
virtual void end_of_line();
|
||||||
// overriden to do logging
|
// overriden to do logging
|
||||||
virtual void SetSyntaxError(PRBool error);
|
virtual void SetSyntaxError(PRBool error);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PRBool fProcessingTaggedResponse;
|
PRPackedBool fProcessingTaggedResponse;
|
||||||
PRBool fCurrentCommandFailed;
|
PRPackedBool fCurrentCommandFailed;
|
||||||
PRBool fReportingErrors;
|
PRPackedBool fReportingErrors;
|
||||||
|
|
||||||
|
|
||||||
PRBool fCurrentFolderReadOnly;
|
PRPackedBool fCurrentFolderReadOnly;
|
||||||
PRBool fCurrentLineContainedFlagInfo;
|
PRPackedBool fCurrentLineContainedFlagInfo;
|
||||||
|
PRPackedBool fFetchingAllFlags;
|
||||||
|
PRPackedBool fWaitingForMoreClientInput;
|
||||||
|
// when issuing a fetch command, are we fetching everything or just a part?
|
||||||
|
PRPackedBool fFetchEverythingRFC822;
|
||||||
|
// Is the server a Netscape 3.x Messaging Server?
|
||||||
|
PRPackedBool fServerIsNetscape3xServer;
|
||||||
|
PRPackedBool fDownloadingHeaders;
|
||||||
|
PRPackedBool fCurrentCommandIsSingleMessageFetch;
|
||||||
|
PRPackedBool fGotPermanentFlags;
|
||||||
imapMessageFlagsType fSavedFlagInfo;
|
imapMessageFlagsType fSavedFlagInfo;
|
||||||
|
|
||||||
|
|
||||||
PRUint16 fSupportsUserDefinedFlags;
|
PRUint16 fSupportsUserDefinedFlags;
|
||||||
PRUint16 fSettablePermanentFlags;
|
PRUint16 fSettablePermanentFlags;
|
||||||
|
|
||||||
PRInt32 fFolderUIDValidity;
|
PRInt32 fFolderUIDValidity;
|
||||||
PRInt32 fNumberOfUnseenMessages;
|
PRInt32 fNumberOfUnseenMessages;
|
||||||
|
@ -234,56 +244,46 @@ private:
|
||||||
PRUint32 fCurrentResponseUID;
|
PRUint32 fCurrentResponseUID;
|
||||||
PRUint32 fHighestRecordedUID;
|
PRUint32 fHighestRecordedUID;
|
||||||
PRInt32 fSizeOfMostRecentMessage;
|
PRInt32 fSizeOfMostRecentMessage;
|
||||||
PRInt32 fTotalDownloadSize;
|
PRInt32 fTotalDownloadSize;
|
||||||
PRBool fFetchingAllFlags;
|
|
||||||
|
|
||||||
int fNumberOfTaggedResponsesExpected;
|
int fNumberOfTaggedResponsesExpected;
|
||||||
|
|
||||||
char *fCurrentCommandTag;
|
char *fCurrentCommandTag;
|
||||||
|
|
||||||
nsCString fZeroLengthMessageUidString;
|
nsCString fZeroLengthMessageUidString;
|
||||||
|
|
||||||
char *fSelectedMailboxName;
|
char *fSelectedMailboxName;
|
||||||
|
|
||||||
nsImapSearchResultSequence *fSearchResults;
|
nsImapSearchResultSequence *fSearchResults;
|
||||||
|
|
||||||
nsCOMPtr <nsIImapFlagAndUidState> fFlagState; // NOT owned by us, it's a copy, do not destroy
|
nsCOMPtr <nsIImapFlagAndUidState> fFlagState; // NOT owned by us, it's a copy, do not destroy
|
||||||
|
|
||||||
eIMAPstate fIMAPstate;
|
eIMAPstate fIMAPstate;
|
||||||
PRBool fWaitingForMoreClientInput;
|
|
||||||
|
|
||||||
PRUint32 fCapabilityFlag;
|
PRUint32 fCapabilityFlag;
|
||||||
char *fMailAccountUrl;
|
char *fMailAccountUrl;
|
||||||
char *fNetscapeServerVersionString;
|
char *fNetscapeServerVersionString;
|
||||||
char *fXSenderInfo; /* changed per message download */
|
char *fXSenderInfo; /* changed per message download */
|
||||||
char *fLastAlert; /* used to avoid displaying the same alert over and over */
|
char *fLastAlert; /* used to avoid displaying the same alert over and over */
|
||||||
char *fManageListsUrl;
|
char *fManageListsUrl;
|
||||||
char *fManageFiltersUrl;
|
char *fManageFiltersUrl;
|
||||||
char *fFolderAdminUrl;
|
char *fFolderAdminUrl;
|
||||||
|
|
||||||
// used for index->uid mapping
|
PRInt32 fUidOfSingleMessageFetch;
|
||||||
PRBool fCurrentCommandIsSingleMessageFetch;
|
PRInt32 fFetchResponseIndex;
|
||||||
PRInt32 fUidOfSingleMessageFetch;
|
|
||||||
PRInt32 fFetchResponseIndex;
|
|
||||||
|
|
||||||
// used for aborting a fetch stream when we're pseudo-Interrupted
|
// used for aborting a fetch stream when we're pseudo-Interrupted
|
||||||
PRBool fDownloadingHeaders;
|
PRInt32 numberOfCharsInThisChunk;
|
||||||
PRInt32 numberOfCharsInThisChunk;
|
PRInt32 charsReadSoFar;
|
||||||
PRInt32 charsReadSoFar;
|
PRBool fLastChunk;
|
||||||
PRBool fLastChunk;
|
|
||||||
// when issuing a fetch command, are we fetching everything or just a part?
|
|
||||||
PRBool fFetchEverythingRFC822;
|
|
||||||
|
|
||||||
// Is the server a Netscape 3.x Messaging Server?
|
// points to the current body shell, if any
|
||||||
PRBool fServerIsNetscape3xServer;
|
nsIMAPBodyShell *m_shell;
|
||||||
|
|
||||||
// points to the current body shell, if any
|
// The connection object
|
||||||
nsIMAPBodyShell *m_shell;
|
|
||||||
|
|
||||||
// The connection object
|
|
||||||
nsImapProtocol &fServerConnection;
|
nsImapProtocol &fServerConnection;
|
||||||
|
|
||||||
nsIImapHostSessionList *fHostSessionList;
|
nsIImapHostSessionList *fHostSessionList;
|
||||||
nsMsgKeyArray fCopyResponseKeyArray;
|
nsMsgKeyArray fCopyResponseKeyArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче