Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Newbie question] S/Mime, how to get the encryption choice from elsewhere

2 views
Skip to first unread message

Gregory BELLIER

unread,
Feb 5, 2010, 5:58:20 AM2/5/10
to dev-apps-t...@lists.mozilla.org
Hi !

Sorry to disturb the mailing-list with this newbie question but I try to
learn.

I try to play with the user interface of Thunderbird 2. When composing
an email, I would like to get the value of the S/Mime encryption choice
and then simply print the value with an alert().

In MsgComposeCommands.js, I tried the following (and some other stuff) :

case "cmd_sendButton" :
[...]
var gEncryptedURIService =
Components.classes["@mozilla.org/messenger-smime/smime-encrypted-uris-service;1"].getService(Components.interfaces.nsIEncryptedSMIMEURIsService);

if (gEncryptedURIService.isEncrypted(gMsgCompose.originalMsgURI))
alert("true");
else alert ("false");

sendMessage();
[...]

What I would like is to get the Encryption choice from either the
account settings / security menu or the security tab at the composing
window. I could also try to get it from the file prefs.js (in the home
directory) which is where the user preferences are saved but I would
prefer to learn how to get a value.

I took a leaf out of "msgCompSMIMEOverlay.js" which reads the default
choices in account setting/ security menu but I can't get it to work
properly.
No matter what I set as an encryption choice, I always end up with the
same result.

Thank you for your help in my learning.

Gr�gory BELLIER.


0 new messages