Partially fixed Thunderbird 3 support.
authorHugo Monteiro <hugo.monteiro@fct.unl.pt>
Sun, 7 Mar 2010 15:44:52 +0000 (15:44 +0000)
committerHugo Monteiro <hugo.monteiro@fct.unl.pt>
Sun, 7 Mar 2010 15:44:52 +0000 (15:44 +0000)
  * Newer versions won't be TB2 compatible.

MFM: 0 days

modified:   chrome/content/dspam.js
modified:   chrome/locale/en-US/dspam.dtd
modified:   install.rdf

chrome/content/dspam.js
chrome/locale/en-US/dspam.dtd
install.rdf

index 6a788b4..d44e1bf 100644 (file)
@@ -15,23 +15,19 @@ onStopSending: function ( msgID , status , msg , returnFileSpec )
 
 };
 
-function MoveToFolder()
-{
-
-}
-
-
 var fwdStatus = 0;
 
 function dspamReportSpam(event) {
 
        var validDspamConfig = true;
+       var spamaction = 0;
        var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+       var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
 
        try {
                var spamaction = pref.getIntPref("dspam.spamaction");
        } catch(e) {
-               spamaction = 0;
+               validDspamConfig = false;
        }
 
        try {
@@ -42,23 +38,23 @@ function dspamReportSpam(event) {
 
        if (spamaction != 0) {
                try {
-                       var spamfolder = RDF.GetResource(pref.getCharPref("dspam.spamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
+                       var spamfolder = rdfService.GetResource(pref.getCharPref("dspam.spamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
                } catch (e) {
                        validDspamConfig = false;
                }
                try {
-                       var hamfolder = RDF.GetResource(pref.getCharPref("dspam.hamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
+                       var hamfolder = rdfService.GetResource(pref.getCharPref("dspam.hamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
                } catch (e) {
                        validDspamConfig = false;
                }
        }
 
-       var folder = GetLoadedMsgFolder();
+       var folder = gFolderDisplay.displayedFolder;
        var rootFolder = folder.rootFolder;
-       var messageArray = GetSelectedMessages();
+       var messageArray = gFolderDisplay.selectedMessageUris;
        var server;
        server = folder.server;
-       var dbv = GetDBView();
+       var dbv = gFolderDisplay.view.dbView;
 
        if (validDspamConfig == true) {
 
@@ -66,7 +62,7 @@ function dspamReportSpam(event) {
 
                msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
 
-               messenger.SetWindow(window, msgWindow);
+               messenger.setWindow(window, msgWindow);
 
                if (messageArray && messageArray.length > 0) {
                        uri = "";
@@ -138,12 +134,14 @@ function dspamReportSpam(event) {
 function dspamReportHam(event) {
 
        var validDspamConfig = true;
+       var hamaction = 0;
        var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+       var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
 
        try {
                var hamaction = pref.getIntPref("dspam.hamaction");
        } catch(e) {
-               hamaction = 0;
+               validDspamConfig = false;
        }
 
        try {
@@ -154,24 +152,24 @@ function dspamReportHam(event) {
 
        if (hamaction != 0) {
                try {
-                       var hamfolder = RDF.GetResource(pref.getCharPref("dspam.hamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
+                       var hamfolder = rdfService.GetResource(pref.getCharPref("dspam.hamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
                } catch (e) {
                        validDspamConfig = false;
                }
                try {
-                       var spamfolder = RDF.GetResource(pref.getCharPref("dspam.spamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
+                       var spamfolder = rdfService.GetResource(pref.getCharPref("dspam.spamfolder")).QueryInterface(Components.interfaces.nsIMsgFolder);
                } catch (e) {
                        validDspamConfig = false;
                }
        }
 
 
-       var folder = GetLoadedMsgFolder();
-       var messageArray = GetSelectedMessages();
+       var folder = gFolderDisplay.displayedFolder;
+       var messageArray = gFolderDisplay.selectedMessageUris;
        var server;
        server = folder.server;
 
-       var dbv = GetDBView();
+       var dbv = gFolderDisplay.view.dbView;
 
        if (validDspamConfig == true) {
 
@@ -196,7 +194,7 @@ function dspamReportHam(event) {
 
                msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
 
-               messenger.SetWindow(window, msgWindow);
+               messenger.setWindow(window, msgWindow);
 
                if (messageArray && messageArray.length > 0) {
                        for (var i = 0; i < messageArray.length; ++i) {
index f5aa225..36ba542 100644 (file)
@@ -7,7 +7,7 @@
 <!ENTITY dspam.spamreportbutton.label "Spam">
 <!ENTITY dspam.spamreportbutton.tooltiptext "Report the selected messages as SPAM">
 <!ENTITY dspam.hamreportbutton.label "Not Spam">
-<!ENTITY dspam.hamreportbutton.tooltiptext "Report the selected messages as SPAM">
+<!ENTITY dspam.hamreportbutton.tooltiptext "Report the selected messages as INNOCENT">
 <!ENTITY dspam.options.spamaddresstooltip "Your SPAM report address">
 <!ENTITY dspam.options.hamaddresstooltip "Your HAM report address">
 <!ENTITY dspam.options.quickspamcop "Enable Quick SpamCop">
index ec1dac6..c37a4d0 100644 (file)
@@ -11,7 +11,7 @@
       <Description>
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
         <em:minVersion>2.0</em:minVersion>
-        <em:maxVersion>3.0</em:maxVersion>
+       <em:maxVersion>3.0.*</em:maxVersion>
       </Description>
     </em:targetApplication>