We now expunge the current selected mailbox whenver we 'leave' the mail module.

Monotone-Parent: 822260d0260bcf1547f7d38fe5a673fcdcb589ad
Monotone-Revision: addd7d5e87d3a58601c005b2b25baaecc4ac4ece

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2008-10-14T17:36:04
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2008-10-14 17:36:04 +00:00
parent 933329f71d
commit 2a5fd5f892

View File

@@ -239,6 +239,19 @@ function ml_lowlight(sender) {
}
function onUnload(event) {
var url = ApplicationBaseURL + encodeURI(Mailer.currentMailbox) + "/expunge";
new Ajax.Request(url, {
method: 'get',
onFailure: function(transport) {
log("Can't expunge current folder: " + transport.status);
}
});
return true;
}
/* bulk delete of messages */
function onDocumentKeydown(event) {
@@ -1431,6 +1444,7 @@ function initMailer(event) {
initMessageCheckTimer();
Event.observe(document, "keydown", onDocumentKeydown);
Event.observe(window, "beforeunload", onUnload);
}
Event.observe(window, "resize", onWindowResize);