From 4c9c6ea68c5998a19917fc12b188ddaa3f3f2648 Mon Sep 17 00:00:00 2001 From: Dan Wilga Date: Tue, 21 Jul 2015 12:56:56 -0400 Subject: [PATCH 01/19] Fix Downloading calendar data fails #282 --- components/ecExchangeRequest.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/ecExchangeRequest.js b/components/ecExchangeRequest.js index 4dace04e..75f27938 100644 --- a/components/ecExchangeRequest.js +++ b/components/ecExchangeRequest.js @@ -1110,6 +1110,7 @@ try { } else { var rm = xml2json.XPath(aResp,"/s:Envelope/s:Body/*/m:ResponseMessages/*[@ResponseClass='Error']"); + var rm = aResp.XPath("/s:Envelope/s:Body/*/m:ResponseMessages/*[@ResponseClass='Error']"); var result; if (rm.length > 0) { result = rm[0].getTagValue("m:MessageText").value+"("+rm[0].getTagValue("m:ResponseCode")+")"; From 671d94b86441793a12e6f7f4b888e649f96221b9 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Wed, 22 Jul 2015 10:23:25 +0530 Subject: [PATCH 02/19] Remove #282 newly added code, continue to last commit --- components/ecExchangeRequest.js | 1 - 1 file changed, 1 deletion(-) diff --git a/components/ecExchangeRequest.js b/components/ecExchangeRequest.js index 75f27938..32464bfe 100644 --- a/components/ecExchangeRequest.js +++ b/components/ecExchangeRequest.js @@ -1109,7 +1109,6 @@ try { } } else { - var rm = xml2json.XPath(aResp,"/s:Envelope/s:Body/*/m:ResponseMessages/*[@ResponseClass='Error']"); var rm = aResp.XPath("/s:Envelope/s:Body/*/m:ResponseMessages/*[@ResponseClass='Error']"); var result; if (rm.length > 0) { From 52b204f4c007c4d99415db3b0d41263133d6d5a9 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Wed, 22 Jul 2015 11:39:04 +0530 Subject: [PATCH 03/19] Revert " Password issues with 3.2.2 and hosted Exchange, no problems with 3.1.3 #42" This reverts commit 32c09ee71473dafd2bb4375f07aa7a441eb48f5f. --- .../mivExchangeAuthPrompt2.js | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js index 503662b4..8cd8e6ce 100644 --- a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js +++ b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js @@ -131,10 +131,23 @@ mivExchangeAuthPrompt2.prototype = { When no password at al always ask. */ - var password=null; - + var password; + if (this.passwordCache[username+"|"+aURL+"|"+realm]) { + this.logInfo("getPassword: There is a password in the passwordCache["+username+"|"+aURL+"|"+realm+"]"); + password = this.passwordCache[username+"|"+aURL+"|"+realm]; + } + else { + this.logInfo("getPassword: There is no password in the passwordCache["+username+"|"+aURL+"|"+realm+"]"); + } + if (this.showPassword) { + this.logInfo("getPassword: password(1)="+password); + } + else { + this.logInfo("getPassword: password(1)=********"); + } + if (!password) { - this.logInfo("getPassword: Going to see if there is one in the passwordManager."); + this.logInfo("getPassword: There is no password in the cache. Going to see if there is one in the passwordManager."); var savedPassword = this.passwordManagerGet(username, aURL, realm); if (savedPassword.result) { this.logInfo("getPassword: There is a password stored in the passwordManager."); @@ -144,32 +157,13 @@ mivExchangeAuthPrompt2.prototype = { this.logInfo("getPassword: There is no password stored in the passwordManager."); } } - if (this.showPassword) { - this.logInfo("getPassword: password(1)="+password); + this.logInfo("getPassword: password(2)="+password); } else { - this.logInfo("getPassword: password(1)=********"); + this.logInfo("getPassword: password(2)=********"); } - - if (!password) { - this.logInfo("getPassword: Going to see if there is one in the passwordCache."); - if (this.passwordCache[username+"|"+aURL+"|"+realm]) { - this.logInfo("getPassword: There is a password in the passwordCache["+username+"|"+aURL+"|"+realm+"]"); - password = this.passwordCache[username+"|"+aURL+"|"+realm]; - } - else { - this.logInfo("getPassword: There is no password in the passwordCache["+username+"|"+aURL+"|"+realm+"]"); - } - if (this.showPassword) { - this.logInfo("getPassword: password(2)="+password); - } - else { - this.logInfo("getPassword: password(2)=********"); - } - } - if ((password) && (aChannel) && (aChannel.URI.password) && (decodeURIComponent(aChannel.URI.password) != "")) { this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. Going to see if they are the same."); if ((password == decodeURIComponent(aChannel.URI.password)) && (!useCached)) { From ca688c8befd90106f9b30a9a33283a4d03494676 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Wed, 22 Jul 2015 14:03:57 +0530 Subject: [PATCH 04/19] Block Adding domain field when username entered with backslash --- chrome/content/exchangeSettingsOverlay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/exchangeSettingsOverlay.js b/chrome/content/exchangeSettingsOverlay.js index 30ff0c53..989587db 100644 --- a/chrome/content/exchangeSettingsOverlay.js +++ b/chrome/content/exchangeSettingsOverlay.js @@ -235,7 +235,7 @@ exchSettingsOverlay.prototype = { exchWebServicesDoUserChanged: function _exchWebServicesDoUserChanged(aTextBox) { this.exchWebServicesgUser = aTextBox.value; - if (this.exchWebServicesgUser.indexOf("@") > -1) { + if ((this.exchWebServicesgUser.indexOf("@") > -1) || (this.exchWebServicesgUser.indexOf("\\") > -1) ){ this._document.getElementById("exchWebService_windowsdomain").disabled = true; this._document.getElementById("exchWebService_windowsdomain").value = ""; //this._document.getElementById("exchWebService_windowsdomain").setAttribute("required", false); From 635c604b42633b32913606e748d690c7864b9d0d Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Fri, 24 Jul 2015 10:02:10 +0530 Subject: [PATCH 05/19] ewsTagger:Error While unsubscribing --- chrome/content/rtews.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/chrome/content/rtews.js b/chrome/content/rtews.js index 9890d8ab..528f401a 100644 --- a/chrome/content/rtews.js +++ b/chrome/content/rtews.js @@ -18,6 +18,7 @@ Cu.import("resource://exchangecalendar/erSubscribe.js"); Cu.import("resource://exchangecalendar/erGetEvents.js"); Cu.import("resource://exchangecalendar/erFindItems.js"); Cu.import("resource://exchangecalendar/erUpdateItem.js"); +Cu.import("resource://exchangecalendar/erUnsubscribe.js"); const eventTypes = ["NewMailEvent","ModifiedEvent","MovedEvent","CopiedEvent","CreatedEvent"]; @@ -296,9 +297,9 @@ rtews.prototype = { }, unsubscribe: function _unsubscribe(){ - var that = this; - that.Running = true; - + exchangeGlobalFunction("Error occured Unsubscribing user.",this.user); + this.Running = false; + var that = this; var tmpObject = new erUnsubscribeRequest( {user: this.user, mailbox: this.mailbox, @@ -312,13 +313,11 @@ rtews.prototype = { }, unsubscribeOK: function _unsubscribeOK(erUnsubscribeRequest, aResp){ - this.Running =false; exchangeGlobalFunction("Unsubscribed user.",this.user); }, unsubscribeError: function _unsubscribeError(erUnsubscribeRequest, aCode, aMsg){ - this.Running =false; - exchangeGlobalFunction("unsubscribeError: "+ aMsg); + exchangeGlobalFunction("unsubscribeError: "+ aMsg); }, poll: function _poll() { From 75b094736cefb715e50336795a1004aafc59c2d3 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Fri, 24 Jul 2015 11:58:32 +0530 Subject: [PATCH 06/19] Revert "Ignore domain request for email usernames" This reverts commit e29742a51ee32c00630f156345ae11eb31c75d32. --- .../mivExchangeAuthPrompt2.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js index 8cd8e6ce..8331a788 100644 --- a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js +++ b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js @@ -361,14 +361,16 @@ mivExchangeAuthPrompt2.prototype = { authInfo.username = username.substr(username.indexOf("\\")+1); this.logInfo("asyncPromptAuthNotifyCallback: We have a domainname part in the username. Going to use it. domain="+authInfo.domain); } - else if (username.indexOf("@") > -1) { - authInfo.username = username; - authInfo.domain = undefined; - this.logInfo("asyncPromptAuthNotifyCallback: We have an E-Mail address as username, therefore discarding the domain property."); - } else { - this.logInfo("asyncPromptAuthNotifyCallback: We do not have a domainname part in the username. Specifying empty one."); - authInfo.username = username; + if (username.indexOf("@") > -1) { + authInfo.username = username.substr(0,username.indexOf("@")); + authInfo.domain = username.substr(username.indexOf("@")+1); + this.logInfo("asyncPromptAuthNotifyCallback: We have a domainname part in the username. Going to use it. domain="+authInfo.domain); + } + else { + this.logInfo("asyncPromptAuthNotifyCallback: We do not have a domainname part in the username. Specifying empty one."); + authInfo.username = username; + } } } else { From ca97609b20bb5c4b87f6eca4c7bb06da082d05ac Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Mon, 27 Jul 2015 14:21:50 +0530 Subject: [PATCH 07/19] correct username domain when entered together --- chrome/content/exchangeSettingsOverlay.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/exchangeSettingsOverlay.js b/chrome/content/exchangeSettingsOverlay.js index 989587db..dbcf5965 100644 --- a/chrome/content/exchangeSettingsOverlay.js +++ b/chrome/content/exchangeSettingsOverlay.js @@ -240,6 +240,12 @@ exchSettingsOverlay.prototype = { this._document.getElementById("exchWebService_windowsdomain").value = ""; //this._document.getElementById("exchWebService_windowsdomain").setAttribute("required", false); this.exchWebServicesgDomain = ""; + + if(this.exchWebServicesgUser.indexOf("\\") > -1){ + var newArray = this.exchWebServicesgUser.split("\\"); + this.exchWebServicesgUser = newArray[1]; + this.exchWebServicesgDomain = newArray[0]; + } } else { this._document.getElementById("exchWebService_windowsdomain").disabled = false; @@ -308,7 +314,7 @@ exchSettingsOverlay.prototype = { exchWebServicesGetUsername: function _exchWebServicesGetUsername() { - if (this.exchWebServicesgUser.indexOf("@") > -1) { + if (this.exchWebServicesgUser.indexOf("@") > -1) { return this.exchWebServicesgUser; } else { From 88e4417127a93212c29faaa72ed7c33e055509dd Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Mon, 27 Jul 2015 14:39:26 +0530 Subject: [PATCH 08/19] prompt new password when last try is 401 --- .../exchangeAuthPrompt2/mivExchangeAuthPrompt2.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js index 8331a788..4c62eb10 100644 --- a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js +++ b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js @@ -145,13 +145,14 @@ mivExchangeAuthPrompt2.prototype = { else { this.logInfo("getPassword: password(1)=********"); } - + var passwordSaved; if (!password) { this.logInfo("getPassword: There is no password in the cache. Going to see if there is one in the passwordManager."); var savedPassword = this.passwordManagerGet(username, aURL, realm); if (savedPassword.result) { this.logInfo("getPassword: There is a password stored in the passwordManager."); password = savedPassword.password; + passwordSaved = savedPassword.password; } else { this.logInfo("getPassword: There is no password stored in the passwordManager."); @@ -171,9 +172,13 @@ mivExchangeAuthPrompt2.prototype = { if ((this.details[aURL]) && (this.details[aURL].ntlmCount == 1)) { this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. And they are the same. But it is a first pass on an NTLM authentication. Using stored password and going to see if it can be used."); } - else { + else { this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. And they are the same. Going to ask user to provide a new password."); - password = null; + var channel = aChannel.QueryInterface(Ci.nsIHttpChannel); + if( channel.responseStatus == 401 ){ + password=null; + this.logInfo("getPassword: Login Failed, Going to ask user to provide a new password."); + } } } else { @@ -184,7 +189,7 @@ mivExchangeAuthPrompt2.prototype = { this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. And useCached specified."); } if (this.showPassword) { - this.logInfo("getPassword: cached/store='"+password+"', on channel='"+decodeURIComponent(aChannel.URI.password)+"'."); + this.logInfo("getPassword: cached/store='"+password+"', on channel='"+decodeURIComponent(aChannel.URI.password)+"', useCached='"+useCached+"'."); } else { this.logInfo("getPassword: cached/store='********', on channel='********'."); From 9730c08315b4cc44d5b5f18ecc6321c83b789113 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Mon, 27 Jul 2015 15:24:31 +0530 Subject: [PATCH 09/19] Remove Saved password if the user doesnt want to keep it --- .../mivExchangeAuthPrompt2.js | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js index 4c62eb10..63f88617 100644 --- a/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js +++ b/interfaces/exchangeAuthPrompt2/mivExchangeAuthPrompt2.js @@ -145,14 +145,15 @@ mivExchangeAuthPrompt2.prototype = { else { this.logInfo("getPassword: password(1)=********"); } - var passwordSaved; - if (!password) { + + var oldSavedPassword; + if (!password) { this.logInfo("getPassword: There is no password in the cache. Going to see if there is one in the passwordManager."); var savedPassword = this.passwordManagerGet(username, aURL, realm); if (savedPassword.result) { this.logInfo("getPassword: There is a password stored in the passwordManager."); password = savedPassword.password; - passwordSaved = savedPassword.password; + oldSavedPassword = savedPassword.password; } else { this.logInfo("getPassword: There is no password stored in the passwordManager."); @@ -229,6 +230,10 @@ mivExchangeAuthPrompt2.prototype = { this.logInfo("getPassword: User requested to store password in passwordmanager."); this.passwordManagerSave(username, password, aURL, realm); } + else{ + this.logInfo("getPassword: User requested not to store password in passwordmanager."); + this.passwordManagerRemove(username, oldSavedPassword, aURL, realm); + } this.passwordCache[username+"|"+aURL+"|"+realm] = password; this.details[aURL].showing = false; } @@ -633,7 +638,43 @@ mivExchangeAuthPrompt2.prototype = { } return { result: false }; }, + + passwordManagerRemove: function _passwordManagerRemove(aUsername, aPassword, aURL, aRealm) + { + + if ((!aUsername) || (!aURL) || (!aRealm)) { + this.logInfo("passwordManagerRemove: username or hostname or realm is empty. Not allowed!!!"); + return; + } + try { + var loginManager = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager); + var logins = loginManager.findLogins({}, aURL, null, aRealm); + + var newLoginInfo = Cc["@mozilla.org/login-manager/loginInfo;1"].createInstance(Ci.nsILoginInfo); + newLoginInfo.init(aURL, null, aRealm, aUsername, aPassword, "", ""); + + if (logins.length > 0) { + var modified = false; + for each (let loginInfo in logins) { + if (loginInfo.username == aUsername) { + this.logInfo("Login credentials updated:username="+aUsername+", aURL="+aURL+", aRealm="+aRealm); + loginManager.removeLogin(loginInfo); + modified = true; + break; + } + } + if (!modified) { + this.logInfo("Login credentials saved:username="+aUsername+", aURL="+aURL+", aRealm="+aRealm); + } + } else { + this.logInfo("Login credentials saved:username="+aUsername+", aURL="+aURL+", aRealm="+aRealm); + } + } catch (exc) { + this.logInfo(exc); + } + }, + /** * Helper to insert/update an entry to the password manager. * From 1a6d06dced767ba58e56845c58362a7c49b4798f Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Mon, 27 Jul 2015 16:27:55 +0530 Subject: [PATCH 10/19] Account hammering #222 --- chrome/content/rtews.js | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/chrome/content/rtews.js b/chrome/content/rtews.js index 528f401a..515d540e 100644 --- a/chrome/content/rtews.js +++ b/chrome/content/rtews.js @@ -230,17 +230,37 @@ function rtews(identity){ this.prefs = identity.prefs ; if( this.prefs ){ - this.pollOffset = this.globalFunctions.safeGetIntPref(this.prefs, "syncMailItems.Interval" ,15) * 1000 ;//time for getevents + this.pollOffset = this.globalFunctions.safeGetIntPref(this.prefs, "syncMailItems.Interval" ,15) * 1000 ;//time for getevents + this.loadBalancer = Cc["@1st-setup.nl/exchange/loadbalancer;1"] + .getService(Ci.mivExchangeLoadBalancer); } else{ this.prefs = null; - this.pollOffset = 15000;//time for getevents + this.pollOffset = 30000;//time for getevents } this.subscriptionTimeout = "1440"; } rtews.prototype = { + /* + *use Calendar queue for xml request + */ + addToQueue: function _addToQueue(aRequest, aArgument, aCbOk, aCbError, aListener) + { + if (this.globalFunctions.safeGetBoolPref(this.prefs, "mailsyncactive", false)) { + exchangeGlobalFunction("Not adding to queue because we are disabled, " + this.serverUrl ,this.user); + return; + } + //if (!aArgument["ServerVersion"]) aArgument["ServerVersion"] = this.exchangeStatistics.getServerVersion(this.serverUrl); + + this.loadBalancer.addToQueue({ calendar: this.prefs, + ecRequest:aRequest, + arguments: aArgument, + cbOk: aCbOk, + cbError: aCbError, + listener: aListener}); + }, /* * Gets the ItemId element from response of the FindItem SOAP request * @@ -249,7 +269,7 @@ rtews.prototype = { exchangeGlobalFunction("Find all the folderd in msgfolderroot, " + this.serverUrl ,this.user); //Call API var self = this; - var tmpObject = new erFindInboxFolderRequest( + this.addToQueue( erFindInboxFolderRequest, {user:this.user, mailbox: this.mailbox, serverUrl:this.serverUrl, @@ -273,7 +293,7 @@ rtews.prototype = { subscribe: function _subscribe(folders){ exchangeGlobalFunction("Trying to subscribe " ,this.user); var self = this; - var tmpObject = new erSubscribeRequest( + this.addToQueue( erSubscribeRequest, {user: this.user, mailbox: this.mailbox, serverUrl: this.serverUrl, @@ -300,7 +320,7 @@ rtews.prototype = { exchangeGlobalFunction("Error occured Unsubscribing user.",this.user); this.Running = false; var that = this; - var tmpObject = new erUnsubscribeRequest( + this.addToQueue( erUnsubscribeRequest, {user: this.user, mailbox: this.mailbox, serverUrl: this.serverUrl, @@ -439,7 +459,7 @@ rtews.prototype = { getAndUpdateItems: function _getAndUpdateItems(aIds) { exchangeGlobalFunction("Received request to update messages, total items to be requested - " + aIds.length, this.user); var that = this; - var tmpObject = new erGetItemsRequest( + this.addToQueue( erGetItemsRequest, {user: this.user, mailbox: this.mailbox, serverUrl: this.serverUrl, @@ -455,7 +475,7 @@ rtews.prototype = { this.Running = true; var that = this; - var tmpObject = new erGetEventsRequest( + this.addToQueue( erGetEventsRequest, {user: this.user, mailbox: this.mailbox, serverUrl: this.serverUrl, @@ -679,7 +699,7 @@ rtews.prototype = { continue; } - var tmpObject = new erFindItemsRequest( + this.addToQueue( erFindItemsRequest, {user: this.user, mailbox: this.mailbox, serverUrl: this.serverUrl, @@ -731,7 +751,7 @@ rtews.prototype = { exchangeGlobalFunction("findItemsError: aCode:" + aCode + " aMsg: " + aMsg ); } - var tmpObject = new erFindItemsRequest( + this.addToQueue( erFindItemsRequest, {user: this.user, mailbox: this.mailbox, serverUrl: this.serverUrl, @@ -773,7 +793,8 @@ rtews.prototype = { exchangeGlobalFunction("UpdateItem with changes " + changes, this.user); - var tmpObject = new erUpdateItemRequest({user: this.user, + this.addToQueue( erUpdateItemRequest, + {user: this.user, mailbox: this.mailbox, folderBase: this.folderBase, serverUrl: this.serverUrl, From 1bba4d869c7dddf80206725397b6e89e435ea4a0 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Mon, 27 Jul 2015 16:56:18 +0530 Subject: [PATCH 11/19] Preference added to disable or enable mail syncing --- chrome/content/exchangeSettings.js | 3 +++ chrome/content/exchangeSettings.xul | 4 ++++ chrome/content/rtews.js | 2 +- locale/exchangecalendar/de/exchangeSettings.dtd | 4 +++- locale/exchangecalendar/en-US/exchangeSettings.dtd | 1 + locale/exchangecalendar/fr-FR/exchangeSettings.dtd | 1 + locale/exchangecalendar/ja-JP/exchangeSettings.dtd | 1 + locale/exchangecalendar/nl/exchangeSettings.dtd | 1 + locale/exchangecalendar/ru/exchangeSettings.dtd | 1 + locale/exchangecalendar/sv/exchangeSettings.dtd | 1 + locale/exchangecalendar/tr/exchangeSettings.dtd | 1 + 11 files changed, 18 insertions(+), 2 deletions(-) diff --git a/chrome/content/exchangeSettings.js b/chrome/content/exchangeSettings.js index f26221cf..79e7d38f 100644 --- a/chrome/content/exchangeSettings.js +++ b/chrome/content/exchangeSettings.js @@ -266,6 +266,8 @@ exchExchangeSettings.prototype = { this._document.getElementById("exchWebService-autoprocessingproperties-markeventtentative").checked = this.globalFunctions.safeGetBoolPref(exchWebServicesCalPrefs, "ecautoprocessingmarkeventtentative", false); this._document.getElementById("exchWebService-syncMailItems-Interval").value = this.globalFunctions.safeGetIntPref(exchWebServicesCalPrefs, "syncMailItems.Interval", 15); + this._document.getElementById("exchWebService-syncMailItems-active").checked = this.globalFunctions.safeGetBoolPref(exchWebServicesCalPrefs, "mailsync.active",true); + if ( this.globalFunctions.safeGetCharPref(exchWebServicesCalPrefs, "ecFolderbase", "") == "calendar" ){ this._document.getElementById("mailItemsPropertiesTab").hidden = false; @@ -333,6 +335,7 @@ exchExchangeSettings.prototype = { if ( this.globalFunctions.safeGetCharPref(exchWebServicesCalPrefs, "ecFolderbase", "") == "calendar" ){ exchWebServicesCalPrefs.setIntPref("syncMailItems.Interval", this._document.getElementById("exchWebService-syncMailItems-Interval").value); + exchWebServicesCalPrefs.setBoolPref("mailsync.active", this._document.getElementById("exchWebService-syncMailItems-active").checked); } //exchWebServicesCalPrefs.setBoolPref("ecPollInbox", this._document.getElementById("exchWebService-poll-inbox").checked); diff --git a/chrome/content/exchangeSettings.xul b/chrome/content/exchangeSettings.xul index 7ebd45e6..af0b5761 100644 --- a/chrome/content/exchangeSettings.xul +++ b/chrome/content/exchangeSettings.xul @@ -417,6 +417,10 @@ increment="1" min="15" type="number" value="15" /> + + + diff --git a/chrome/content/rtews.js b/chrome/content/rtews.js index 515d540e..3bba1d77 100644 --- a/chrome/content/rtews.js +++ b/chrome/content/rtews.js @@ -248,7 +248,7 @@ rtews.prototype = { */ addToQueue: function _addToQueue(aRequest, aArgument, aCbOk, aCbError, aListener) { - if (this.globalFunctions.safeGetBoolPref(this.prefs, "mailsyncactive", false)) { + if (this.globalFunctions.safeGetBoolPref(this.prefs, "mailsync.active", true)) { exchangeGlobalFunction("Not adding to queue because we are disabled, " + this.serverUrl ,this.user); return; } diff --git a/locale/exchangecalendar/de/exchangeSettings.dtd b/locale/exchangecalendar/de/exchangeSettings.dtd index 37084b31..5a12403a 100644 --- a/locale/exchangecalendar/de/exchangeSettings.dtd +++ b/locale/exchangecalendar/de/exchangeSettings.dtd @@ -46,4 +46,6 @@ - + + + diff --git a/locale/exchangecalendar/en-US/exchangeSettings.dtd b/locale/exchangecalendar/en-US/exchangeSettings.dtd index 7788d246..e2150494 100644 --- a/locale/exchangecalendar/en-US/exchangeSettings.dtd +++ b/locale/exchangecalendar/en-US/exchangeSettings.dtd @@ -48,4 +48,5 @@ + diff --git a/locale/exchangecalendar/fr-FR/exchangeSettings.dtd b/locale/exchangecalendar/fr-FR/exchangeSettings.dtd index f79090d6..0e67da94 100644 --- a/locale/exchangecalendar/fr-FR/exchangeSettings.dtd +++ b/locale/exchangecalendar/fr-FR/exchangeSettings.dtd @@ -50,3 +50,4 @@ + diff --git a/locale/exchangecalendar/ja-JP/exchangeSettings.dtd b/locale/exchangecalendar/ja-JP/exchangeSettings.dtd index ac3f37d4..480e60b9 100644 --- a/locale/exchangecalendar/ja-JP/exchangeSettings.dtd +++ b/locale/exchangecalendar/ja-JP/exchangeSettings.dtd @@ -49,3 +49,4 @@ + diff --git a/locale/exchangecalendar/nl/exchangeSettings.dtd b/locale/exchangecalendar/nl/exchangeSettings.dtd index b5706bfd..476b4043 100644 --- a/locale/exchangecalendar/nl/exchangeSettings.dtd +++ b/locale/exchangecalendar/nl/exchangeSettings.dtd @@ -50,3 +50,4 @@ + diff --git a/locale/exchangecalendar/ru/exchangeSettings.dtd b/locale/exchangecalendar/ru/exchangeSettings.dtd index 521eb830..0578e03f 100644 --- a/locale/exchangecalendar/ru/exchangeSettings.dtd +++ b/locale/exchangecalendar/ru/exchangeSettings.dtd @@ -49,3 +49,4 @@ + diff --git a/locale/exchangecalendar/sv/exchangeSettings.dtd b/locale/exchangecalendar/sv/exchangeSettings.dtd index 13fa28b7..15e3cf77 100644 --- a/locale/exchangecalendar/sv/exchangeSettings.dtd +++ b/locale/exchangecalendar/sv/exchangeSettings.dtd @@ -48,3 +48,4 @@ + diff --git a/locale/exchangecalendar/tr/exchangeSettings.dtd b/locale/exchangecalendar/tr/exchangeSettings.dtd index 1cfd499b..f653a3b4 100644 --- a/locale/exchangecalendar/tr/exchangeSettings.dtd +++ b/locale/exchangecalendar/tr/exchangeSettings.dtd @@ -49,3 +49,4 @@ + From 3e2d127f9ba1a8c85f099113ff3a32ad85c4b410 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Mon, 27 Jul 2015 17:02:54 +0530 Subject: [PATCH 12/19] ewsTagger: Preference added to disable or enable mail syncing(2) --- chrome/content/rtews.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/rtews.js b/chrome/content/rtews.js index 3bba1d77..8bb636b1 100644 --- a/chrome/content/rtews.js +++ b/chrome/content/rtews.js @@ -248,7 +248,7 @@ rtews.prototype = { */ addToQueue: function _addToQueue(aRequest, aArgument, aCbOk, aCbError, aListener) { - if (this.globalFunctions.safeGetBoolPref(this.prefs, "mailsync.active", true)) { + if (! this.globalFunctions.safeGetBoolPref(this.prefs, "mailsync.active", true) ) { exchangeGlobalFunction("Not adding to queue because we are disabled, " + this.serverUrl ,this.user); return; } From e0628ba0250d7cf6cc5c3b52f5476531a985a1dd Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Mon, 27 Jul 2015 18:23:11 +0530 Subject: [PATCH 13/19] ewsTagger: Preferece and some basic syncing chnaged --- chrome/content/rtews.js | 112 +++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 64 deletions(-) diff --git a/chrome/content/rtews.js b/chrome/content/rtews.js index 8bb636b1..24607e7b 100644 --- a/chrome/content/rtews.js +++ b/chrome/content/rtews.js @@ -203,14 +203,19 @@ rtews.Tags = { function rtews(identity){ this.identity = identity; // fixing bug #270 - - if( identity.domain){ - this.user = identity.domain +"\\"+identity.username ; - } - else { - this.user = identity.username ; - } - + + if (identity.username.indexOf("@") > -1) { + this.user = identity.username ; + } + else { + if (identity.domain == "") { + this.user = identity.username ; + } + else { + this.user = identity.domain +"\\"+identity.username ; + } + } + this.mailbox = identity.email ; this.serverUrl = identity.ewsUrl ; @@ -248,12 +253,13 @@ rtews.prototype = { */ addToQueue: function _addToQueue(aRequest, aArgument, aCbOk, aCbError, aListener) { - if (! this.globalFunctions.safeGetBoolPref(this.prefs, "mailsync.active", true) ) { + if ( mivFunctions.safeGetBoolPref(this.prefs, "mailsync.active", false) == false ){ exchangeGlobalFunction("Not adding to queue because we are disabled, " + this.serverUrl ,this.user); + this.Running = false; return; } //if (!aArgument["ServerVersion"]) aArgument["ServerVersion"] = this.exchangeStatistics.getServerVersion(this.serverUrl); - + this.loadBalancer.addToQueue({ calendar: this.prefs, ecRequest:aRequest, arguments: aArgument, @@ -1054,36 +1060,25 @@ function getAllAccounts(){ var identity = identities.queryElementAt(index, Ci.nsIMsgIdentity); var calAccount = getCalendarPref(identity.email); var enabled = false; - exchangeGlobalFunction("Account exists for email address - " + identity.email); + exchangeGlobalFunction("Account exists for email address - " + identity.email); var details = null; - if(calAccount){ - enabled = true; - details = { - "server":account.incomingServer.prettyName, - "serverURI":account.incomingServer.serverURI, - "email":calAccount.getCharPref("ecMailbox"), - "username":calAccount.getCharPref("ecUser"), - "name":identity.fullName, - "domain":calAccount.getCharPref("ecDomain"), - "enabled":enabled, - "ewsUrl":calAccount.getCharPref("ecServer"), - "prefs" : calAccount ,}; - } - else{ - details = { - "server":account.incomingServer.prettyName, - "serverURI":account.incomingServer.serverURI, - "email":null, - "username":null, - "name":identity.fullName, - "domain":null, - "enabled":enabled, - "ewsUrl":null, - "prefs" : null ,}; - } - - if( details.enabled == true){ + + if(calAccount && mivFunctions ){ + enabled = mivFunctions.safeGetBoolPref(calAccount, "mailsync.active", false) ; + details = { + "server":account.incomingServer.prettyName, + "serverURI":account.incomingServer.serverURI, + "email":mivFunctions.safeGetCharPref(calAccount,"ecMailbox"), + "username":mivFunctions.safeGetCharPref(calAccount,"ecUser"), + "name":identity.fullName, + "domain":mivFunctions.safeGetCharPref(calAccount,"ecDomain"), + "enabled":enabled, + "ewsUrl":mivFunctions.safeGetCharPref(calAccount,"ecServer"), + "prefs" : calAccount , + }; + } + if( details.enabled == true){ _accounts.push(details); } } @@ -1106,33 +1101,22 @@ function getAllAccounts(){ exchangeGlobalFunction("Account exists for email address - " + identity.email); let details = null; - if(calAccount){ - enabled = true; - details = { - "server":account.incomingServer.prettyName, - "serverURI":account.incomingServer.serverURI, - "email":calAccount.getCharPref("ecMailbox"), - "username":calAccount.getCharPref("ecUser"), - "name":identity.fullName, - "domain":calAccount.getCharPref("ecDomain"), - "enabled":enabled, - "ewsUrl":calAccount.getCharPref("ecServer"), - "prefs" : calAccount ,}; - } - else{ - details = { - "server":account.incomingServer.prettyName, - "serverURI":account.incomingServer.serverURI, - "email":null, - "username":null, - "name":identity.fullName, - "domain":null, - "enabled":enabled, - "ewsUrl":null, - "prefs" : null ,}; - } - if( details.enabled == true ){ + if(calAccount && mivFunctions ){ + enabled = mivFunctions.safeGetBoolPref(calAccount, "mailsync.active", false) ; + details = { + "server":account.incomingServer.prettyName, + "serverURI":account.incomingServer.serverURI, + "email":mivFunctions.safeGetCharPref(calAccount,"ecMailbox"), + "username":mivFunctions.safeGetCharPref(calAccount,"ecUser"), + "name":identity.fullName, + "domain":mivFunctions.safeGetCharPref(calAccount,"ecDomain"), + "enabled":enabled, + "ewsUrl":mivFunctions.safeGetCharPref(calAccount,"ecServer"), + "prefs" : calAccount , + }; + } + if( details.enabled == true ){ _accounts.push(details); } } From e19e484f3cd2a21df949f32dfbd7bcc0db7f28cb Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Tue, 28 Jul 2015 09:45:24 +0530 Subject: [PATCH 14/19] ewsTagger: Preference --- chrome/content/exchangeSettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/exchangeSettings.js b/chrome/content/exchangeSettings.js index 79e7d38f..407592d4 100644 --- a/chrome/content/exchangeSettings.js +++ b/chrome/content/exchangeSettings.js @@ -266,7 +266,7 @@ exchExchangeSettings.prototype = { this._document.getElementById("exchWebService-autoprocessingproperties-markeventtentative").checked = this.globalFunctions.safeGetBoolPref(exchWebServicesCalPrefs, "ecautoprocessingmarkeventtentative", false); this._document.getElementById("exchWebService-syncMailItems-Interval").value = this.globalFunctions.safeGetIntPref(exchWebServicesCalPrefs, "syncMailItems.Interval", 15); - this._document.getElementById("exchWebService-syncMailItems-active").checked = this.globalFunctions.safeGetBoolPref(exchWebServicesCalPrefs, "mailsync.active",true); + this._document.getElementById("exchWebService-syncMailItems-active").checked = this.globalFunctions.safeGetBoolPref(exchWebServicesCalPrefs, "mailsync.active",false); if ( this.globalFunctions.safeGetCharPref(exchWebServicesCalPrefs, "ecFolderbase", "") == "calendar" ){ From 171dbd39be773b039fd56ab731adb0ee354cc0d7 Mon Sep 17 00:00:00 2001 From: enozkan Date: Tue, 28 Jul 2015 00:07:24 -0500 Subject: [PATCH 15/19] Update exchangeSettings.dtd --- locale/exchangecalendar/tr/exchangeSettings.dtd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/exchangecalendar/tr/exchangeSettings.dtd b/locale/exchangecalendar/tr/exchangeSettings.dtd index f653a3b4..fec7ab5b 100644 --- a/locale/exchangecalendar/tr/exchangeSettings.dtd +++ b/locale/exchangecalendar/tr/exchangeSettings.dtd @@ -49,4 +49,4 @@ - + From 6aa791f8c3ee8e9215daa383d296233da22f02f6 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Tue, 28 Jul 2015 11:16:21 +0530 Subject: [PATCH 16/19] ewsTagger: locally update on server disconnect --- chrome/content/rtews.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/chrome/content/rtews.js b/chrome/content/rtews.js index 24607e7b..a9929fad 100644 --- a/chrome/content/rtews.js +++ b/chrome/content/rtews.js @@ -720,7 +720,7 @@ rtews.prototype = { } else{ exchangeGlobalFunction("Syncing tags not finding any items in server for Ids. " + JSON.stringify(messageId), that.user); - } + } }, function(erFindItemsRequest, aCode, aMsg) { exchangeGlobalFunction("findItemsError: aCode:" + aCode + " aMsg: " + aMsg ); @@ -750,12 +750,15 @@ rtews.prototype = { } else{ exchangeGlobalFunction("Toggle tags not finding any items in server for Ids. " + JSON.stringify(messageId), that.user); + //when no mail item is find toggle tags locally + exchangeGlobalFunction("Update tags locally",that.user); + rtews.fallBackTagUpdate(msgHdr, identity, toggleType, categories, key, addKey); } } function findItemsError(erFindItemsRequest, aCode, aMsg){ exchangeGlobalFunction("findItemsError: aCode:" + aCode + " aMsg: " + aMsg ); - } + } this.addToQueue( erFindItemsRequest, {user: this.user, @@ -832,6 +835,18 @@ rtews.prototype = { }, }; + +/* + * On remote fails + */ +rtews.fallBackTagUpdate = function(msgHdr, identity, toggleType, categories, key, addKey){ + if (toggleType == "removeAll") { + rtews.removeAllMessageTagsPostEwsUpdate(msgHdr); + } else { + rtews.toggleMessageTagPostEwsUpdate(key, addKey, msgHdr); + } +}; + /* * Custom method for remove all tags menuitem */ From 924ad8bc12330133fa933b09c1c122aeeef5fce0 Mon Sep 17 00:00:00 2001 From: Babu Vincent Date: Tue, 28 Jul 2015 16:09:46 +0530 Subject: [PATCH 17/19] ewsTagger: fix error typeerror ids --- chrome/content/rtews.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/chrome/content/rtews.js b/chrome/content/rtews.js index a9929fad..9188c93f 100644 --- a/chrome/content/rtews.js +++ b/chrome/content/rtews.js @@ -964,12 +964,14 @@ rtews.addSyncMenu = function (menuPopup) { */ rtews.getIdentity = function(server) { var ids = identities; - for (var x = 0, len = ids.length; x < len; x++) { - if (ids[x] && ids[x].enabled == true && ids[x].server == server) { - return ids[x]; - } + if( ids ){ + for (var x = 0, len = ids.length; x < len; x++) { + if (ids[x] && ids[x].enabled == true && ids[x].server == server) { + return ids[x]; + } + } } - return null; + return null; }; //Get all the identities From b9f2b661cee3784a558354e2fe53f8c9d339f238 Mon Sep 17 00:00:00 2001 From: Dominique Date: Tue, 28 Jul 2015 13:08:50 +0200 Subject: [PATCH 18/19] Update exchangeSettings.dtd Added French translation for the file exchangeSettings.dtd --- locale/exchangecalendar/fr-FR/exchangeSettings.dtd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/exchangecalendar/fr-FR/exchangeSettings.dtd b/locale/exchangecalendar/fr-FR/exchangeSettings.dtd index 0e67da94..539338e2 100644 --- a/locale/exchangecalendar/fr-FR/exchangeSettings.dtd +++ b/locale/exchangecalendar/fr-FR/exchangeSettings.dtd @@ -50,4 +50,4 @@ - + From e4479b6451febeceee7e5c83ae21c4a1f54504f7 Mon Sep 17 00:00:00 2001 From: Danny Baumann Date: Thu, 13 Aug 2015 15:31:02 +0200 Subject: [PATCH 19/19] Update German translation. --- .../de/calExchangeCalendar.properties | 2 +- .../de/delegate-calendar-dialog.dtd | 6 +- .../exchangecalendar/de/delegate-folder.dtd | 70 +++++++++---------- .../exchangecalendar/de/exchangeSettings.dtd | 8 +-- .../de/exchangeSettingsOverlay.dtd | 2 +- .../exchangecalendar/de/manageEWSAccounts.dtd | 2 +- locale/exchangecalendar/de/rtews.dtd | 30 ++++---- .../de/timezonePreference.dtd | 2 +- 8 files changed, 61 insertions(+), 61 deletions(-) diff --git a/locale/exchangecalendar/de/calExchangeCalendar.properties b/locale/exchangecalendar/de/calExchangeCalendar.properties index 781cf174..9cb592b5 100644 --- a/locale/exchangecalendar/de/calExchangeCalendar.properties +++ b/locale/exchangecalendar/de/calExchangeCalendar.properties @@ -16,7 +16,7 @@ ewsMeetingResponsEventMessage=Besprechungsanfrage "%1$S" beantwortet mit "%2$S" ecErrorServerCheck=Fehler bei Abfrage des Servers:%1$S (%2$S) ecErrorAutodiscovery=Fehler bei Autodiscovery:%1$S (%2$S) -ecErrorAutodiscoveryURLInvalid=Die Postfacheinstellungen konnten nicht durch Autodiscovery mit dem Domainnamen des Postfachs ermittelt werden. (%1$S).\nNormalerweise bedeutet dies, dass kein Autodiscovery-Server mit dem Domainnamen als Hostnamen definiert ist. +ecErrorAutodiscoveryURLInvalid=Die Postfacheinstellungen konnten nicht durch Autodiscovery in der Domäne des Postfachs ermittelt werden. (%1$S).\nNormalerweise bedeutet dies, dass kein Autodiscovery-Server mit dem Name der Domäne als Hostname definiert ist. ecErrorServerCheckURLInvalid=Server "%1$S" existiert nicht. ecErrorServerAndMailboxCheck=Fehler bei der Abfrage des Servers und des Postfachs:%1$S (Code: %2$S) diff --git a/locale/exchangecalendar/de/delegate-calendar-dialog.dtd b/locale/exchangecalendar/de/delegate-calendar-dialog.dtd index 52eb16c2..760cf541 100644 --- a/locale/exchangecalendar/de/delegate-calendar-dialog.dtd +++ b/locale/exchangecalendar/de/delegate-calendar-dialog.dtd @@ -7,10 +7,10 @@ - + - - + + diff --git a/locale/exchangecalendar/de/delegate-folder.dtd b/locale/exchangecalendar/de/delegate-folder.dtd index 2ce88d16..cf59c8d1 100644 --- a/locale/exchangecalendar/de/delegate-folder.dtd +++ b/locale/exchangecalendar/de/delegate-folder.dtd @@ -1,45 +1,45 @@ - + - - - + + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - - - - - + + + + + + + + - - + + diff --git a/locale/exchangecalendar/de/exchangeSettings.dtd b/locale/exchangecalendar/de/exchangeSettings.dtd index 5a12403a..7189b21f 100644 --- a/locale/exchangecalendar/de/exchangeSettings.dtd +++ b/locale/exchangecalendar/de/exchangeSettings.dtd @@ -44,8 +44,8 @@ - - - - + + + + diff --git a/locale/exchangecalendar/de/exchangeSettingsOverlay.dtd b/locale/exchangecalendar/de/exchangeSettingsOverlay.dtd index c1790510..2e86f2e2 100644 --- a/locale/exchangecalendar/de/exchangeSettingsOverlay.dtd +++ b/locale/exchangecalendar/de/exchangeSettingsOverlay.dtd @@ -41,7 +41,7 @@ - + diff --git a/locale/exchangecalendar/de/manageEWSAccounts.dtd b/locale/exchangecalendar/de/manageEWSAccounts.dtd index b3ac5336..ab937944 100644 --- a/locale/exchangecalendar/de/manageEWSAccounts.dtd +++ b/locale/exchangecalendar/de/manageEWSAccounts.dtd @@ -7,7 +7,7 @@ - + diff --git a/locale/exchangecalendar/de/rtews.dtd b/locale/exchangecalendar/de/rtews.dtd index b60f11fd..00af607b 100755 --- a/locale/exchangecalendar/de/rtews.dtd +++ b/locale/exchangecalendar/de/rtews.dtd @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/locale/exchangecalendar/de/timezonePreference.dtd b/locale/exchangecalendar/de/timezonePreference.dtd index a61aa649..e0dd46ac 100644 --- a/locale/exchangecalendar/de/timezonePreference.dtd +++ b/locale/exchangecalendar/de/timezonePreference.dtd @@ -1 +1 @@ - +