diff --git a/chrome/content/check4lightning.js b/chrome/content/check4lightning.js index 59eaddf9..68cec5ef 100644 --- a/chrome/content/check4lightning.js +++ b/chrome/content/check4lightning.js @@ -179,13 +179,17 @@ exchCheck4Lightning.prototype = { updaterCallBack: function _updaterCallBack(aResult) { - if (aResult.versionChanged <= 0) { - this.globalFunctions.LOG("No new version available."); + + if (aResult.versionChanged <= 0) { + if(aResult.error){ + this.globalFunctions.LOG("updaterCallBack: Unable to fetch from url"); + } + this.globalFunctions.LOG("updaterCallBack: No new version available."); } else { - this.globalFunctions.LOG("New version available."); - this.globalFunctions.LOG(" ++ Version:"+aResult.updateDetails.newVersion); - this.globalFunctions.LOG(" ++ URL:"+aResult.updateDetails.updateURL); + this.globalFunctions.LOG("updaterCallBack: New version available."); + this.globalFunctions.LOG("updaterCallBack: ++ Version:"+aResult.updateDetails.newVersion); + this.globalFunctions.LOG("updaterCallBack: ++ URL:"+aResult.updateDetails.updateURL); var self = this; if (this.globalFunctions.safeGetBoolPref(null, "extensions.1st-setup.others.warnAboutNewAddOnVersion", true, true)) { // this.lightningAlertTimer2.initWithCallback(function(aResult){ self.lightningAlertCallback2(aResult);}, 15000, this.lightningAlertTimer2.TYPE_ONE_SHOT); diff --git a/components/erUpdateItem.js b/components/erUpdateItem.js index 99cc3f52..2b610adc 100644 --- a/components/erUpdateItem.js +++ b/components/erUpdateItem.js @@ -66,14 +66,21 @@ function erUpdateItemRequest(aArgument, aCbOk, aCbError, aListener) this.serverUrl = aArgument.serverUrl; this.listener = aListener; this.updateReq = aArgument.updateReq; - + this.onlySnoozeChanges=aArgument.onlySnoozeChanges; + this.sendto = "sendtoall"; if (aArgument.sendto) { this.sendto = aArgument.sendto; } this.isRunning = true; - this.execute("AutoResolve"); + if(this.onlySnoozeChanges){ + this.execute("AlwaysOverwrite"); + } + else + { + this.execute("AutoResolve"); + } } erUpdateItemRequest.prototype = { diff --git a/interfaces/exchangeCalendar/mivExchangeCalendar.js b/interfaces/exchangeCalendar/mivExchangeCalendar.js index bb51633f..59e8c1db 100644 --- a/interfaces/exchangeCalendar/mivExchangeCalendar.js +++ b/interfaces/exchangeCalendar/mivExchangeCalendar.js @@ -1688,6 +1688,7 @@ calExchangeCalendar.prototype = { newItem: aNewItem, actionStart: Date.now(), attachmentsUpdates: attachmentsUpdates, + onlySnoozeChanges:changesObj.onlySnoozeChanged, sendto: input.response}, function(erUpdateItemRequest, aId, aChangeKey) { self.updateItemOk(erUpdateItemRequest, aId, aChangeKey);}, function(erUpdateItemRequest, aCode, aMsg) { self.whichOccurrencegetOccurrenceIndexError(erUpdateItemRequest, aCode, aMsg);}, @@ -1734,6 +1735,7 @@ calExchangeCalendar.prototype = { newItem: aNewItem, actionStart: Date.now(), attachmentsUpdates: attachmentsUpdates, + onlySnoozeChanges:changesObj.onlySnoozeChanged, sendto: input.response}, function(erUpdateItemRequest, aId, aChangeKey) { self.updateItemOk(erUpdateItemRequest, aId, aChangeKey);}, function(erUpdateItemRequest, aCode, aMsg) { self.whichOccurrencegetOccurrenceIndexError(erUpdateItemRequest, aCode, aMsg);}, diff --git a/interfaces/updater/mivUpdater.js b/interfaces/updater/mivUpdater.js index dce03ab0..187f79cf 100644 --- a/interfaces/updater/mivUpdater.js +++ b/interfaces/updater/mivUpdater.js @@ -240,14 +240,16 @@ mivUpdater.prototype = { addonByIDCallback: function _addonByIDCallback(aAddon) { if (aAddon) { + var url="https://api.github.com/repos/Ericsson/exchangecalendar/releases"; this._addon = aAddon; - this._updateURL = this.safeGetCharPref(null, EXTENSION_MAINPART+this._extensionID, "https://api.github.com/repos/Ericsson/exchangecalendar/releases", true); - this._updateURL = "https://api.github.com/repos/Ericsson/exchangecalendar/releases"; + this._updateURL = this.safeGetCharPref(null, EXTENSION_MAINPART+this._extensionID, url, true); + this._updateURL = url; this.xmlReq = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(); var tmp = this; this.xmlReq.addEventListener("error", function(evt) { tmp.onUpdateDetailsError(evt); }, false); this.xmlReq.addEventListener("load", function(evt) { tmp.onUpdateDetailsLoad(evt, tmp.xmlReq); }, false); + this.xmlReq.addEventListener("progress", function(evt) { tmp.onUpdateDetailsProgress(evt); }, false); var appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); @@ -267,14 +269,21 @@ mivUpdater.prototype = { } } }, - + + onUpdateDetailsProgress: function _onUpdateDetailsProgress(evt) + { + dump("\nonUpdateDetailsProgress- total: " + evt.total + " loaded: " +evt.loaded ); + }, + onUpdateDetailsError: function _onUpdateDetailsError(evt) { - this._callBack({addon: this._addon, extensionID: this._extensionID, versionChanged: 0, error: Ci.mivUpdater.ERR_GETTING_REMOTE_UPDATE_DETAILS}); + dump("\nonUpdateDetailsError"); + this._callBack({addon: this._addon, extensionID: this._extensionID, versionChanged: 0, error: Ci.mivUpdater.ERR_ADDON_NOT_FOUND_BY_ID}); }, onUpdateDetailsLoad: function _onUpdateDetailsLoad(evt, xmlReq) { + dump("\nonUpdateDetailsLoad"); if (xmlReq.readyState != 4) { this._callBack({addon: null, extensionID: this._extensionID, versionChanged: 0, error: Ci.mivUpdater.ERR_WRONG_READYSTATE}); }