diff --git a/mozilla/mail/base/content/commandglue.js b/mozilla/mail/base/content/commandglue.js index d106a62481c..472bb77cb97 100644 --- a/mozilla/mail/base/content/commandglue.js +++ b/mozilla/mail/base/content/commandglue.js @@ -1154,10 +1154,12 @@ function OnLeavingFolder(aFolder) { try { - if (gPrefBranch.getBoolPref("mailnews.mark_message_read." + aFolder.server.type)) + // Mark all messages of aFolder as read: + // We can't use the command controller, because it is already tuned in to the + // new folder, so we just mimic its behaviour wrt goDoCommand('cmd_markAllRead'). + if (gDBView && gPrefBranch.getBoolPref("mailnews.mark_message_read." + aFolder.server.type)) { - // mark all messages of aFolder as read - goDoCommand('cmd_markAllRead'); + gDBView.doCommand(nsMsgViewCommandType.markAllRead); } } catch(e){/* ignore */} diff --git a/mozilla/mailnews/base/resources/content/commandglue.js b/mozilla/mailnews/base/resources/content/commandglue.js index 042afae5474..25fcd24c746 100644 --- a/mozilla/mailnews/base/resources/content/commandglue.js +++ b/mozilla/mailnews/base/resources/content/commandglue.js @@ -1193,10 +1193,12 @@ function OnLeavingFolder(aFolder) { try { - if (gPrefBranch.getBoolPref("mailnews.mark_message_read." + aFolder.server.type)) + // Mark all messages of aFolder as read: + // We can't use the command controller, because it is already tuned in to the + // new folder, so we just mimic its behaviour wrt goDoCommand('cmd_markAllRead'). + if (gDBView && gPrefBranch.getBoolPref("mailnews.mark_message_read." + aFolder.server.type)) { - // mark all messages of aFolder as read - goDoCommand('cmd_markAllRead'); + gDBView.doCommand(nsMsgViewCommandType.markAllRead); } } catch(e){/* ignore */}