1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-12-21 21:48:47 -05:00

enable Chat only in Thunderbird (not Seamonkey!)

This commit is contained in:
foudfou 2012-09-04 10:50:17 +02:00
parent 97237aaffe
commit de2a756fc8
4 changed files with 12 additions and 9 deletions

2
TODO
View File

@ -1,8 +1,6 @@
TODO TODO
---- ----
* no Chat in Seamonkey !
WONTFIX WONTFIX
------- -------

View File

@ -33,6 +33,7 @@ firetray.Handler = {
initialized: false, initialized: false,
inBrowserApp: false, inBrowserApp: false,
inMailApp: false, inMailApp: false,
appHasChat: false,
appStarted: false, appStarted: false,
windows: {}, windows: {},
windowsCount: 0, windowsCount: 0,
@ -59,7 +60,7 @@ firetray.Handler = {
// version checked during install, so we shouldn't need to care // version checked during install, so we shouldn't need to care
let xulVer = Services.appinfo.platformVersion; // Services.vc.compare(xulVer,"2.0a")>=0 let xulVer = Services.appinfo.platformVersion; // Services.vc.compare(xulVer,"2.0a")>=0
log.debug("OS=" + this.runtimeOS + ", ABI=" + this.runtimeABI + ", XULrunner=" + xulVer); log.info("OS=" + this.runtimeOS + ", ABI=" + this.runtimeABI + ", XULrunner=" + xulVer);
switch (this.runtimeOS) { switch (this.runtimeOS) {
case "Linux": case "Linux":
Cu.import("resource://firetray/linux/FiretrayStatusIcon.jsm"); Cu.import("resource://firetray/linux/FiretrayStatusIcon.jsm");
@ -76,7 +77,9 @@ firetray.Handler = {
this.inMailApp = true; this.inMailApp = true;
if (this.appId === FIRETRAY_FIREFOX_ID || this.appId === FIRETRAY_SEAMONKEY_ID) if (this.appId === FIRETRAY_FIREFOX_ID || this.appId === FIRETRAY_SEAMONKEY_ID)
this.inBrowserApp = true; this.inBrowserApp = true;
log.debug('inMailApp: '+this.inMailApp+', inBrowserApp: '+this.inBrowserApp); if (this.appId === FIRETRAY_THUNDERBIRD_ID && Services.vc.compare(xulVer,"15.0")>=0)
this.appHasChat = true;
log.info('inMailApp='+this.inMailApp+', inBrowserApp='+this.inBrowserApp+', appHasChat='+this.appHasChat);
this.appStartupTopic = this.getAppStartupTopic(this.appId); this.appStartupTopic = this.getAppStartupTopic(this.appId);

View File

@ -10,7 +10,6 @@ Cu.import("resource:///modules/mailServices.js");
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PluralForm.jsm"); Cu.import("resource://gre/modules/PluralForm.jsm");
Cu.import("resource://firetray/commons.js"); Cu.import("resource://firetray/commons.js");
Cu.import("resource://firetray/FiretrayChat.jsm");
const FLDRS_UNINTERESTING = { const FLDRS_UNINTERESTING = {
Archive: Ci.nsMsgFolderFlags.Archive, Archive: Ci.nsMsgFolderFlags.Archive,
@ -47,10 +46,13 @@ firetray.Messaging = {
MailServices.mailSession.AddFolderListener(that.mailSessionListener, MailServices.mailSession.AddFolderListener(that.mailSessionListener,
that.mailSessionListener.notificationFlags); that.mailSessionListener.notificationFlags);
if (Services.prefs.getBoolPref("mail.chat.enabled") && if (firetray.Handler.appHasChat &&
Services.prefs.getBoolPref("mail.chat.enabled") &&
firetray.Utils.prefService.getBoolPref("chat_icon_enable") && firetray.Utils.prefService.getBoolPref("chat_icon_enable") &&
this.existsChatAccount()) this.existsChatAccount()) {
Cu.import("resource://firetray/FiretrayChat.jsm");
firetray.Chat.init(); firetray.Chat.init();
}
this.initialized = true; this.initialized = true;
}, },
@ -59,7 +61,7 @@ firetray.Messaging = {
if (!this.initialized) return; if (!this.initialized) return;
log.debug("Disabling Messaging"); log.debug("Disabling Messaging");
if (firetray.hasOwnProperty('Chat')) firetray.Chat.shutdown(); if (firetray.Handler.appHasChat) firetray.Chat.shutdown();
MailServices.mailSession.RemoveFolderListener(this.mailSessionListener); MailServices.mailSession.RemoveFolderListener(this.mailSessionListener);

View File

@ -588,7 +588,7 @@ firetray.Handler.registerWindow = function(win) {
this.windows[xid].filterWindowCb = gdk.GdkFilterFunc_t(firetray.Window.filterWindow); this.windows[xid].filterWindowCb = gdk.GdkFilterFunc_t(firetray.Window.filterWindow);
gdk.gdk_window_add_filter(gdkWin, this.windows[xid].filterWindowCb, null); gdk.gdk_window_add_filter(gdkWin, this.windows[xid].filterWindowCb, null);
if (firetray.Handler.inMailApp && firetray.Chat.initialized) { // missing import ok if (firetray.Handler.appHasChat && firetray.Chat.initialized) { // missing import ok
Cu.import("resource://firetray/linux/FiretrayChatStatusIcon.jsm"); Cu.import("resource://firetray/linux/FiretrayChatStatusIcon.jsm");
firetray.ChatStatusIcon.attachOnFocusInCallback(xid); firetray.ChatStatusIcon.attachOnFocusInCallback(xid);
} }