Bug 152526 Followup to detect external mailto via the protocol handler instead of reading the preference directly r=biesi
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 08 Dec 2009 19:35:08 +0000
changeset 4503 ede628c2cf8f12520af09f2e37a580fc7141f042
parent 4502 8d71436563b58670ab934bc81c6b49258c8dcfd5
child 4504 70338c4e8c39191878da1b5da8fa9bc367c4755d
push idunknown
push userunknown
push dateunknown
reviewersbiesi
bugs152526
Bug 152526 Followup to detect external mailto via the protocol handler instead of reading the preference directly r=biesi
suite/browser/mailNavigatorOverlay.xul
--- a/suite/browser/mailNavigatorOverlay.xul
+++ b/suite/browser/mailNavigatorOverlay.xul
@@ -4,32 +4,36 @@
 
 <!DOCTYPE overlay SYSTEM "chrome://navigator/locale/mailNavigatorOverlay.dtd" >
 
 <overlay id="mailNavigatorOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script type="application/javascript">
   <![CDATA[
-    var gUseExternalMailto = Application.prefs.getValue("network.protocol-handler.external.mailto", false);
+    var gUseExternalMailto =
+        Components.classes["@mozilla.org/network/io-service;1"]
+                  .getService(Components.interfaces.nsIIOService)
+                  .getProtocolHandler("mailto")
+                   instanceof Components.interfaces.nsIExternalProtocolHandler;
 
     // attachment: 0 - link
     //             1 - page
     //             2 - image
     function openComposeWindow(url, title, attachment, charset)
     {
       if (gUseExternalMailto) {
         openExternalMailer(url, title);
       }
       else {
         var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"]
                                .createInstance(Components.interfaces.nsIMsgComposeParams);
         if (params)
         {
-          params.composeFields = Components.classes['@mozilla.org/messengercompose/composefields;1']
+          params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"]
                                            .createInstance(Components.interfaces.nsIMsgCompFields);
           if (params.composeFields)
           {
             if (attachment == 0 || attachment == 1)
             {
               params.composeFields.body = url;
               params.composeFields.subject = title;
               params.bodyIsLink = true;