stop biff from putting up alerts when server down r=naving,sr=mscott 59802

This commit is contained in:
bienvenu%netscape.com 2001-01-09 23:02:47 +00:00
Родитель d070fefa62
Коммит 54bbd86f73
5 изменённых файлов: 35 добавлений и 7 удалений

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

@ -70,6 +70,7 @@ interface nsIMsgMailNewsUrl : nsIURL {
attribute boolean updatingFolder;
attribute boolean addToMemoryCache;
attribute boolean msgIsInLocalCache;
attribute boolean suppressErrorMsgs; // used to avoid displaying biff error messages
readonly attribute nsICachedNetData memCacheEntry;

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

@ -51,6 +51,7 @@ nsMsgMailNewsUrl::nsMsgMailNewsUrl()
m_updatingFolder = PR_FALSE;
m_addContentToCache = PR_FALSE;
m_msgIsInLocalCache = PR_FALSE;
m_suppressErrorMsgs = PR_FALSE;
nsComponentManager::CreateInstance(kUrlListenerManagerCID, nsnull, NS_GET_IID(nsIUrlListenerManager), (void **) getter_AddRefs(m_urlListeners));
nsComponentManager::CreateInstance(kStandardUrlCID, nsnull, NS_GET_IID(nsIURL), (void **) getter_AddRefs(m_baseURL));
@ -334,6 +335,19 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetMsgIsInLocalCache(PRBool aMsgIsInLocalCache)
return NS_OK;
}
NS_IMETHODIMP nsMsgMailNewsUrl::GetSuppressErrorMsgs(PRBool *aSuppressErrorMsgs)
{
NS_ENSURE_ARG(aSuppressErrorMsgs);
*aSuppressErrorMsgs = m_suppressErrorMsgs;
return NS_OK;
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetSuppressErrorMsgs(PRBool aSuppressErrorMsgs)
{
m_suppressErrorMsgs = aSuppressErrorMsgs;
return NS_OK;
}
NS_IMETHODIMP nsMsgMailNewsUrl::IsUrlType(PRUint32 type, PRBool *isType)
{
//base class doesn't know about any specific types

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

@ -70,6 +70,7 @@ protected:
PRBool m_updatingFolder;
PRBool m_addContentToCache;
PRBool m_msgIsInLocalCache;
PRBool m_suppressErrorMsgs;
// the following field is really a bit of a hack to make
// open attachments work. The external applications code sometimes trys to figure out the right

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

@ -3977,14 +3977,23 @@ nsImapProtocol::DiscoverMailboxSpec(nsImapMailboxSpec * adoptedBoxSpec)
void
nsImapProtocol::AlertUserEventUsingId(PRUint32 aMessageId)
{
if (m_imapServerSink)
if (m_imapServerSink)
{
PRUnichar *progressString = nsnull;
m_imapServerSink->GetImapStringByID(aMessageId, &progressString);
nsCOMPtr<nsIMsgWindow> msgWindow;
GetMsgWindow(getter_AddRefs(msgWindow));
m_imapServerSink->FEAlert(progressString, msgWindow);
PR_FREEIF(progressString);
PRBool suppressErrorMsg = PR_FALSE;
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_runningUrl);
if (mailnewsUrl)
mailnewsUrl->GetSuppressErrorMsgs(&suppressErrorMsg);
if (!suppressErrorMsg)
{
PRUnichar *progressString = nsnull;
m_imapServerSink->GetImapStringByID(aMessageId, &progressString);
nsCOMPtr<nsIMsgWindow> msgWindow;
GetMsgWindow(getter_AddRefs(msgWindow));
m_imapServerSink->FEAlert(progressString, msgWindow);
PR_FREEIF(progressString);
}
}
}

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

@ -209,6 +209,9 @@ nsImapService::SelectFolder(nsIEventQueue * aClientEventQueue,
rv = imapUrl->SetImapAction(nsIImapUrl::nsImapSelectFolder);
nsCOMPtr <nsIMsgMailNewsUrl> mailNewsUrl = do_QueryInterface(imapUrl);
// if no msg window, we won't put up error messages (this is almost certainly a biff-inspired get new msgs)
if (!aMsgWindow)
mailNewsUrl->SetSuppressErrorMsgs(PR_TRUE);
mailNewsUrl->SetMsgWindow(aMsgWindow);
mailNewsUrl->SetUpdatingFolder(PR_TRUE);
imapUrl->AddChannelToLoadGroup();