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

experimental handling of Exquilla accounts

This commit is contained in:
foudfou 2012-08-29 11:46:12 +02:00
parent 693611c994
commit aaef6a1544
3 changed files with 17 additions and 4 deletions

View File

@ -32,4 +32,4 @@ pref("extensions.firetray.folder_count_recursive", true);
// Ci.nsMsgFolderFlags.Archive|Drafts|Junk|Queue|SentMail|Trash|Virtual
pref("extensions.firetray.excluded_folders_flags", 1077956384);
// exposed in 1 tree, hence 2 branches: serverTypes, excludedAccounts
pref("extensions.firetray.mail_accounts", '{ "serverTypes": {"pop3":{"order":1,"excluded":false}, "imap":{"order":1,"excluded":false}, "movemail":{"order":2,"excluded":true}, "none":{"order":3,"excluded":false}, "rss":{"order":4,"excluded":true}, "nntp":{"order":5,"excluded":true}}, "excludedAccounts": [] }'); // JSON
pref("extensions.firetray.mail_accounts", '{ "serverTypes": {"pop3":{"order":1,"excluded":false}, "imap":{"order":1,"excluded":false}, "movemail":{"order":2,"excluded":true}, "none":{"order":3,"excluded":false}, "rss":{"order":4,"excluded":true}, "nntp":{"order":5,"excluded":true}, "exquilla":{"order":6,"excluded":true}}, "excludedAccounts": [] }'); // JSON

View File

@ -82,6 +82,7 @@ firetray.Handler = {
VersionChange.addHook(["install", "upgrade", "reinstall"], firetray.VersionChangeHandler.showReleaseNotes);
VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.tryEraseOldOptions);
VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.correctMailNotificationType);
VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.correctMailServerTypes);
VersionChange.applyHooksAndWatchUninstall();
firetray.StatusIcon.init();
@ -363,8 +364,6 @@ firetray.VersionChangeHandler = {
showReleaseNotes: function() {
firetray.VersionChangeHandler.openTab(FIRETRAY_SPLASH_PAGE+"#v"+FIRETRAY_VERSION);
firetray.VersionChangeHandler.tryEraseOldOptions();
firetray.VersionChangeHandler.correctMailNotificationType();
},
openTab: function(url) {
@ -438,6 +437,17 @@ firetray.VersionChangeHandler = {
FIRETRAY_NOTIFICATION_NEWMAIL_ICON);
F.WARN("mail notification type set to newmail icon.");
}
},
correctMailServerTypes: function() {
let mailAccounts = firetray.Utils.getObjPref('mail_accounts');
let serverTypes = mailAccounts["serverTypes"];
if (!serverTypes["exquilla"]) {
serverTypes["exquilla"] = {"order":6,"excluded":true};
let prefObj = {"serverTypes":serverTypes, "excludedAccounts":mailAccounts["excludedAccounts"]};
firetray.Utils.setObjPref('mail_accounts', prefObj);
F.WARN("mail server types corrected");
}
}
};

View File

@ -274,7 +274,10 @@ firetray.Messaging = {
try {
let accounts = new this.Accounts();
for (let accountServer in accounts) {
if (accountServer.type === 'im') continue; // IM messages are counted elsewhere
if (!serverTypes[accountServer.type]) {
F.WARN("'"+accountServer.type+"' server type is not handled");
continue;
}
F.LOG("is servertype excluded: "+serverTypes[accountServer.type].excluded+", account exclusion index: "+excludedAccounts.indexOf(accountServer.key));
if (serverTypes[accountServer.type].excluded ||
(excludedAccounts.indexOf(accountServer.key) >= 0))