Fixing bug 393727, Add ability to listen to imap |UpdateFolder()| calls. r=bienvenu, sr=mscott.

This commit is contained in:
nick.kreeger%park.edu 2007-08-30 06:02:09 +00:00
Родитель c9579ec9d9
Коммит 8d3018c820
2 изменённых файлов: 11 добавлений и 6 удалений

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

@ -45,7 +45,7 @@ interface nsIMsgParseMailMsgState;
// this is a simple interface which allows the imap folder to update some values
// that the folder props js code will use to update the sharing and quota tabs in the folder props.
[scriptable, uuid(09D99F2C-3E23-4f8c-A536-5C277BAA9585)]
interface nsIMsgImapFolderProps : nsISupports {
@ -75,7 +75,7 @@ interface nsIMsgImapFolderProps : nsISupports {
void setQuotaData(in ACString quotaroot, in unsigned long usedKB, in unsigned long maxKB);
};
[scriptable, uuid(578B22E3-D9F8-4039-92D7-FF273F53D885)]
[scriptable, uuid(D84129DF-02BA-4268-9927-BCE0008083D9)]
interface nsIMsgImapMailFolder : nsISupports {
void removeSubFolder(in nsIMsgFolder folder);
void createClientSubfolderInfo(in ACString folderName, in wchar hierarchyDelimiter, in long flags, in boolean suppressNotification);
@ -102,6 +102,7 @@ interface nsIMsgImapMailFolder : nsISupports {
void refreshFolderRights();
void updateStatus(in nsIUrlListener aListener, in nsIMsgWindow aMsgWindow);
void updateFolder(in nsIMsgWindow aWindow, in nsIUrlListener aListener);
// this is used to issue an arbitrary imap command on the passed in msgs.
// It assumes the command needs to be run in the selected state.
nsIURI issueCommandOnMsgs(in ACString command, in string uids, in nsIMsgWindow aWindow);

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

@ -676,8 +676,12 @@ nsresult nsImapMailFolder::GetDatabase(nsIMsgWindow *aMsgWindow)
return folderOpen;
}
NS_IMETHODIMP
nsImapMailFolder::UpdateFolder(nsIMsgWindow *msgWindow)
NS_IMETHODIMP nsImapMailFolder::UpdateFolder(nsIMsgWindow * inMsgWindow)
{
return UpdateFolder(inMsgWindow, nsnull);
}
NS_IMETHODIMP nsImapMailFolder::UpdateFolder(nsIMsgWindow *msgWindow, nsIUrlListener *aUrlListener)
{
nsresult rv;
PRBool selectFolder = PR_FALSE;
@ -783,7 +787,7 @@ nsImapMailFolder::UpdateFolder(nsIMsgWindow *msgWindow)
nsCOMPtr <nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(url, &rv);
NS_ENSURE_SUCCESS(rv, rv);
mailnewsUrl->RegisterListener(this);
m_urlListener = nsnull;
m_urlListener = aUrlListener;
}
switch (rv)
{
@ -807,7 +811,6 @@ nsImapMailFolder::UpdateFolder(nsIMsgWindow *msgWindow)
return rv;
}
NS_IMETHODIMP nsImapMailFolder::GetMessages(nsIMsgWindow *aMsgWindow, nsISimpleEnumerator* *result)
{
NS_ENSURE_ARG_POINTER(result);
@ -2757,6 +2760,7 @@ nsresult nsImapMailFolder::NormalEndHeaderParseStream(nsIImapProtocol *aProtocol
// If this is the inbox, try to apply filters.
if (mFlags & MSG_FOLDER_FLAG_INBOX)
{
//XXX Add the roaming service sniffing here....
PRUint32 msgFlags;
newMsgHdr->GetFlags(&msgFlags);
if (!(msgFlags & (MSG_FLAG_READ | MSG_FLAG_IMAP_DELETED))) // only fire on unread msgs that haven't been deleted