MozillaZine

Thunderbird - cancel sending mail

Talk about add-ons and extension development.
mpawlak
 
Posts: 16
Joined: February 24th, 2008, 4:48 am
Location: Gliwice, Poland

Post Posted January 13th, 2009, 9:26 am

Hi,

I am writing some code that is executed after the "Send" button has been pressed in the composition Window. I am verifying the receiver's certificate in code that is executed in verificationListener. If I detect that the certificate is revoked, I want to cancel sending the message. I tried calling window.close(). This closed the composition window. However, I cannot view any messages after doing that.

Is there a safe way to cancel sending a message?

Thank you,
Marek Pawlak

Rod Whiteley

User avatar
 
Posts: 11480
Joined: December 6th, 2004, 3:41 am
Location: UK

Post Posted January 13th, 2009, 1:02 pm

The design seems to be that you use the compose-send-message event to run your code, and call its preventDefault if you need to stop the message. See: http://mxr.mozilla.org/comm-central/sou ... ds.js#1815
Rod

mpawlak
 
Posts: 16
Joined: February 24th, 2008, 4:48 am
Location: Gliwice, Poland

Post Posted January 14th, 2009, 7:21 am

Thank you Rod!

At first, I put my changes in MsgComposeCommands.js but in the end I decided to call onCancel from SendProgress.js
Your suggestion was very helpful and certainly pointed me in the right direction

Marek

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests