fix updating of msg counts in standalone msg window, r=cavin, sr=sspitzer 20119

This commit is contained in:
bienvenu%netscape.com 2002-11-06 00:26:06 +00:00
Родитель 3f8539e5c0
Коммит ecab593125
1 изменённых файлов: 22 добавлений и 2 удалений

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

@ -50,7 +50,27 @@ var folderListener = {
},
OnItemPropertyChanged: function(item, property, oldValue, newValue) {},
OnItemIntPropertyChanged: function(item, property, oldValue, newValue) { },
OnItemIntPropertyChanged: function(item, property, oldValue, newValue) {
var currentLoadedFolder = GetLoadedMsgFolder();
if (!currentLoadedFolder) return;
var currentURI = currentLoadedFolder.URI;
//if we don't have a folder loaded, don't bother.
if(currentURI) {
if(property.GetUnicode() == "TotalMessages" || property.GetUnicode() == "TotalUnreadMessages") {
var folder = item.QueryInterface(Components.interfaces.nsIMsgFolder);
if(folder) {
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
if(folderResource) {
var folderURI = folderResource.Value;
if(currentURI == folderURI) {
UpdateStandAloneMessageCounts();
}
}
}
}
}
},
OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {},
OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue){},
OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) {},
@ -228,7 +248,7 @@ function OnLoadMessageWindow()
try {
var nsIFolderListener = Components.interfaces.nsIFolderListener;
var notifyFlags = nsIFolderListener.removed | nsIFolderListener.event;
var notifyFlags = nsIFolderListener.removed | nsIFolderListener.event | nsIFolderListener.intPropertyChanged;
mailSession.AddFolderListener(folderListener, notifyFlags);
} catch (ex) {
dump("Error adding to session: " +ex + "\n");