From 3d299efb970894d5dd6ab3018136ce544f2b24fb Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Fri, 5 Mar 2004 15:31:13 +0000 Subject: [PATCH] add imap idle support 141369 sr=mscott --- mailnews/base/util/nsMsgLineBuffer.cpp | 6 ++++++ mailnews/base/util/nsMsgLineBuffer.h | 4 +++- mailnews/mailnews.js | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mailnews/base/util/nsMsgLineBuffer.cpp b/mailnews/base/util/nsMsgLineBuffer.cpp index 7dce0904e05..ecd32bacd6f 100644 --- a/mailnews/base/util/nsMsgLineBuffer.cpp +++ b/mailnews/base/util/nsMsgLineBuffer.cpp @@ -460,3 +460,9 @@ char * nsMsgLineStreamBuffer::ReadNextLine(nsIInputStream * aInputStream, PRUint aPauseForMoreData = PR_TRUE; return nsnull; // if we somehow got here. we don't have another line in the buffer yet...need to wait for more data... } + +PRBool nsMsgLineStreamBuffer::NextLineAvailable() +{ + return (m_numBytesInBuffer > 0 && PL_strchr(m_dataBuffer+m_startPos, m_lineToken)); +} + diff --git a/mailnews/base/util/nsMsgLineBuffer.h b/mailnews/base/util/nsMsgLineBuffer.h index 227e8c5ae85..d6986a53873 100644 --- a/mailnews/base/util/nsMsgLineBuffer.h +++ b/mailnews/base/util/nsMsgLineBuffer.h @@ -113,7 +113,8 @@ public: // PR_FALSE if you do want to see them. // aLineToken -- Specify the line token to look for, by default is LF ('\n') which cover as well CRLF. If // lines are terminated with a CR only, you need to set aLineToken to CR ('\r') - nsMsgLineStreamBuffer(PRUint32 aBufferSize, PRBool aAllocateNewLines, PRBool aEatCRLFs = PR_TRUE, char aLineToken = '\n'); // specify the size of the buffer you want the class to use.... + nsMsgLineStreamBuffer(PRUint32 aBufferSize, PRBool aAllocateNewLines, + PRBool aEatCRLFs = PR_TRUE, char aLineToken = '\n'); // specify the size of the buffer you want the class to use.... virtual ~nsMsgLineStreamBuffer(); // Caller must free the line returned using PR_Free @@ -122,6 +123,7 @@ public: // aPauseForMoreData -- There is not enough data in the stream to make a line at this time... char * ReadNextLine(nsIInputStream * aInputStream, PRUint32 &anumBytesInLine, PRBool &aPauseForMoreData, nsresult *rv = nsnull); nsresult GrowBuffer(PRInt32 desiredSize); + PRBool NextLineAvailable(); protected: PRBool m_eatCRLFs; PRBool m_allocateNewLines; diff --git a/mailnews/mailnews.js b/mailnews/mailnews.js index bb97a4d4e66..9b7eb0ef1c2 100644 --- a/mailnews/mailnews.js +++ b/mailnews/mailnews.js @@ -374,7 +374,7 @@ pref("mail.server.default.canFileMessages", true); // special enhancements for IMAP servers pref("mail.server.default.store_read_mail_in_pfc", false); pref("mail.server.default.store_sent_mail_in_pfc", false); - +pref("mail.server.default.use_idle", true); // for spam pref("mail.server.default.spamLevel",100); // 0 off, 100 on. not doing bool since we might have real levels one day. pref("mail.server.default.moveOnSpam",false);