Skip to content

Commit

Permalink
Merge branch 'master' into ec-3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Muthu Subramanian committed Feb 24, 2015
2 parents 947333e + f3e86c8 commit 1405a95
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
14 changes: 9 additions & 5 deletions chrome/content/check4lightning.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 9 additions & 2 deletions components/erUpdateItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions interfaces/exchangeCalendar/mivExchangeCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);},
Expand Down Expand Up @@ -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);},
Expand Down
17 changes: 13 additions & 4 deletions interfaces/updater/mivUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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});
}
Expand Down

0 comments on commit 1405a95

Please sign in to comment.