Bug 955489 - Add a way to pref off JS prpls, r=clokep.
--- a/im/app/profile/all-instantbird.js
+++ b/im/app/profile/all-instantbird.js
@@ -301,8 +301,12 @@ pref("browser.tabs.tabClipWidth", 140);
// 2 no close buttons at all
// 3 at the end of the tabstrip
pref("browser.tabs.closeButtons", 1);
#expand pref("chat.irc.defaultQuitMessage", "Instantbird __APP_VERSION__ -- http://www.instantbird.com");
pref("chat.twitter.consumerKey", "TSuyS1ieRAkB3qWv8yyEw");
pref("chat.twitter.consumerSecret", "DKtKaSf5a7pBNhdBsSZHTnI5Y03hRlPFYWmb4xXBlkU");
+
+// Comma separated list of prpl ids that should use libpurple even if there is
+// a JS implementation. This is used to land JS-prpls pref'ed off in nightlies.
+pref("chat.prpls.forcePurple", "");
--- a/im/modules/ibCore.jsm
+++ b/im/modules/ibCore.jsm
@@ -15,16 +15,33 @@ var Core = {
_events: [
"account-disconnected",
"browser-request",
"quit-application-requested"
],
get bundle() l10nHelper("chrome://instantbird/locale/core.properties"),
+ initLibpurpleOverrides: function() {
+ let forcePurple = Services.prefs.getCharPref("chat.prpls.forcePurple")
+ .split(",")
+ .map(String.trim)
+ .filter(function(aPrplId) !!aPrplId);
+ if (!forcePurple.length)
+ return;
+
+ let catMan =
+ Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
+ for (let prplId of forcePurple) {
+ catMan.addCategoryEntry("im-protocol-plugin", prplId,
+ "@instantbird.org/purple/protocol;1",
+ false, true);
+ }
+ },
+
init: function() {
try {
// Set the Vendor for breakpad only
if ("nsICrashReporter" in Ci) {
Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsICrashReporter)
.annotateCrashReport("Vendor", "Instantbird");
}
@@ -38,16 +55,18 @@ var Core = {
return false;
}
if (!Components.classes["@mozilla.org/chat/core-service;1"]) {
this._promptError("startupFailure.xpcomRegistrationError");
return false;
}
+ this.initLibpurpleOverrides();
+
try {
Services.core.init();
}
catch (e) {
this._promptError("startupFailure.purplexpcomInitError", e);
return false;
}