0

I have a Thunderbird add-on and should to fix some bugs.

I need to handle deleting messages and do some actions, but I don't get any information about onDeleteEvent.

I only found this page and tried to use

document.addEventListener("onMessagesRemoved", function() {
  Application.console.log('deleted');
});  

But nothing happens.

How I can handle delete messages event?

Just a student
  • 10,560
  • 2
  • 41
  • 69

1 Answers1

0

The notification is fired on listeners of nsIMsgFolders. So you need folder.addEventListener, not document.addEventListener. You have to provide a listener for each specific folder that you want to watch deletion for.

(reference: http://mxr.mozilla.org/comm-central/source/mailnews/base/public/nsIMsgFolder.idl#652)

Jonathan Protzenko
  • 1,709
  • 8
  • 13