Commits

Blake Winton committed 0a49296

Update the components stuff to work with the new jetpack.

  • Participants
  • Parent commits 2d52c79

Comments (0)

Files changed (4)

packages/thunderbird-rest-api/lib/httpd.js

  * httpd.js.
  */
 
-const CC = Components.Constructor;
+const {Cc,Ci,Cr,Cu,components} = require("chrome");
+const CC = components.Constructor;
 
 const PR_UINT32_MAX = Math.pow(2, 32) - 1;
 
 /**
  * JavaScript constructors for commonly-used classes; precreating these is a
  * speedup over doing the same from base principles.  See the docs at
- * http://developer.mozilla.org/en/docs/Components.Constructor for details.
+ * http://developer.mozilla.org/en/docs/components.Constructor for details.
  */
 const ServerSocket = CC("@mozilla.org/network/server-socket;1",
                         "nsIServerSocket",
           dumpn("*** preamble copying complete " +
                 "[status=0x" + statusCode.toString(16) + "]");
 
-          if (!Components.isSuccessCode(statusCode))
+          if (!components.isSuccessCode(statusCode))
           {
             dumpn("!!! header copying problems: non-success statusCode, " +
                   "ending response");
           }
           else
           {
-            if (!Components.isSuccessCode(statusCode))
+            if (!components.isSuccessCode(statusCode))
               dumpn("*** WARNING: non-success statusCode in onStopRequest");
 
             response.end();
   function ci(outer, iid)
   {
     if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
+      throw components.results.NS_ERROR_NO_AGGREGATION;
     return (new ctor()).QueryInterface(iid);
   } 
 
   {
     server:
     {
-      CID:         Components.ID("{54ef6f81-30af-4b1d-ac55-8ba811293e41}"),
+      CID:         components.ID("{54ef6f81-30af-4b1d-ac55-8ba811293e41}"),
       contractID:  "@mozilla.org/server/jshttp;1",
       className:   "httpd.js server",
       factory:     makeFactory(nsHttpServer)

packages/thunderbird-rest-api/lib/main.js

   var server = require("tb-rest-api").Server(PORT);
   console.log("Serving HTTP on port", PORT);
 };
+
+const {components} = require("chrome");

packages/thunderbird-rest-api/lib/tb-utils.js

+const {Cu,Cc,Ci} = require("chrome");
+
 var jsm = {};
 Cu.import("resource:///modules/gloda/public.js", jsm);
 Cu.import("resource:///modules/gloda/indexer.js", jsm);
   // Taken from mail/test/mozmill/content-policy/test-js-content-policy.js.
 
   if (!('id' in options))
-    options.id = Components.classes["@mozilla.org/uuid-generator;1"]
-                 .getService(Components.interfaces.nsIUUIDGenerator)
+    options.id = Cc["@mozilla.org/uuid-generator;1"]
+                 .getService(Ci.nsIUUIDGenerator)
                  .generateUUID() +"@mozillamessaging.invalid";
 
   let source = "From - Sat Nov  1 12:39:54 2008\n" +
                  
   source +=  "\n" + options.body + "\n";
 
-  options.folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder);
+  options.folder.QueryInterface(Ci.nsIMsgLocalMailFolder);
   options.folder.gettingNewMessages = true;
 
   options.folder.addMessage(source);

packages/thunderbird-rest-api/package.json

 {
-    "id": "jid0-i7Xoci4lXavsb51ErG6wdZBYkn4"
+    "id": "jid0-i7Xoci4lXavsb51ErG6wdZBYkn4",
+    "id": "jid0-0Quq6qKnsNBbeVkFyv5t5q5RGp8"
 }