mirror of
https://github.com/moparisthebest/FireTray
synced 2024-12-21 05:28:48 -05:00
enable Chat only in Thunderbird (not Seamonkey!)
This commit is contained in:
parent
97237aaffe
commit
de2a756fc8
@ -33,6 +33,7 @@ firetray.Handler = {
|
||||
initialized: false,
|
||||
inBrowserApp: false,
|
||||
inMailApp: false,
|
||||
appHasChat: false,
|
||||
appStarted: false,
|
||||
windows: {},
|
||||
windowsCount: 0,
|
||||
@ -59,7 +60,7 @@ firetray.Handler = {
|
||||
|
||||
// version checked during install, so we shouldn't need to care
|
||||
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) {
|
||||
case "Linux":
|
||||
Cu.import("resource://firetray/linux/FiretrayStatusIcon.jsm");
|
||||
@ -76,7 +77,9 @@ firetray.Handler = {
|
||||
this.inMailApp = true;
|
||||
if (this.appId === FIRETRAY_FIREFOX_ID || this.appId === FIRETRAY_SEAMONKEY_ID)
|
||||
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);
|
||||
|
||||
|
@ -10,7 +10,6 @@ Cu.import("resource:///modules/mailServices.js");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/PluralForm.jsm");
|
||||
Cu.import("resource://firetray/commons.js");
|
||||
Cu.import("resource://firetray/FiretrayChat.jsm");
|
||||
|
||||
const FLDRS_UNINTERESTING = {
|
||||
Archive: Ci.nsMsgFolderFlags.Archive,
|
||||
@ -47,10 +46,13 @@ firetray.Messaging = {
|
||||
MailServices.mailSession.AddFolderListener(that.mailSessionListener,
|
||||
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") &&
|
||||
this.existsChatAccount())
|
||||
this.existsChatAccount()) {
|
||||
Cu.import("resource://firetray/FiretrayChat.jsm");
|
||||
firetray.Chat.init();
|
||||
}
|
||||
|
||||
this.initialized = true;
|
||||
},
|
||||
@ -59,7 +61,7 @@ firetray.Messaging = {
|
||||
if (!this.initialized) return;
|
||||
log.debug("Disabling Messaging");
|
||||
|
||||
if (firetray.hasOwnProperty('Chat')) firetray.Chat.shutdown();
|
||||
if (firetray.Handler.appHasChat) firetray.Chat.shutdown();
|
||||
|
||||
MailServices.mailSession.RemoveFolderListener(this.mailSessionListener);
|
||||
|
||||
|
@ -588,7 +588,7 @@ firetray.Handler.registerWindow = function(win) {
|
||||
this.windows[xid].filterWindowCb = gdk.GdkFilterFunc_t(firetray.Window.filterWindow);
|
||||
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");
|
||||
firetray.ChatStatusIcon.attachOnFocusInCallback(xid);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user