diff --git a/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js b/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js index 64901c8faa1..5aac245707e 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js @@ -14,7 +14,7 @@ * The Original Code is Google Calendar Provider code. * * The Initial Developer of the Original Code is - * Philipp Kewisch (mozilla@kewis.ch) + * Philipp Kewisch * Portions created by the Initial Developer are Copyright (C) 2006 * the Initial Developer. All Rights Reserved. * @@ -99,7 +99,7 @@ calGoogleCalendar.prototype = { /** * readonly attribute googleCalendarName * Google's Calendar name. This represents the in - * http://www.google.com/calendar/feeds//private/full + * http[s]://www.google.com/calendar/feeds//private/full */ get googleCalendarName() { return this.mCalendarName; @@ -227,17 +227,9 @@ calGoogleCalendar.prototype = { // Set internal Calendar Name this.mCalendarName = decodeURIComponent(matches[2]); - var ioService = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - - // Set normalized url. We need the full xml stream and private - // access. We need private visibility and full projection - this.mFullUri = ioService.newURI("http://www.google.com" + - "/calendar/feeds/" + - matches[2] + - "/private/full", - null, - null); + // Set normalized url. We need private visibility and full projection + this.mFullUri = aUri.clone(); + this.mFullUri.path = "/calendar/feeds/" + matches[2] + "/private/full"; // Remember the uri as it was passed, in case the calendar manager // relies on it. @@ -682,7 +674,7 @@ calGoogleCalendar.prototype = { // Parse all tags for each (var entry in xml.entry) { - var item = XMLEntryToItem(entry, timezone); + var item = XMLEntryToItem(entry, timezone, this); if (item) { var itemReturnOccurrences = @@ -769,7 +761,7 @@ calGoogleCalendar.prototype = { var timezone = getPrefSafe("calendar.timezone.local"); // Parse the Item with the given timezone - var item = XMLEntryToItem(xml, timezone); + var item = XMLEntryToItem(xml, timezone, this); LOGitem(item); item.calendar = this; diff --git a/mozilla/calendar/providers/gdata/components/calGoogleRequest.js b/mozilla/calendar/providers/gdata/components/calGoogleRequest.js index 304d170a3f1..184ae61b0fe 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleRequest.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleRequest.js @@ -14,7 +14,7 @@ * The Original Code is Google Calendar Provider code. * * The Initial Developer of the Original Code is - * Philipp Kewisch (mozilla@kewis.ch) + * Philipp Kewisch * Portions created by the Initial Developer are Copyright (C) 2006 * the Initial Developer. All Rights Reserved. * @@ -97,8 +97,6 @@ calGoogleRequest.prototype = { this.mUriString = "https://www.google.com/accounts/ClientLogin"; break; case this.META: - this.uri = "http://www.google.com/calendar/feeds/" + - encodeURIComponent(this.mSession.googleUser); // Fall through case this.GET: this.mMethod = "GET"; @@ -229,7 +227,7 @@ calGoogleRequest.prototype = { if (aSession) { this.mSession = aSession; if (this.mType == this.META) { - this.mUriString = "http://www.google.com/calendar/feeds/" + this.mUriString = aSession.uri.prePath + "/calendar/feeds/" + encodeURIComponent(aSession.googleUser); } } diff --git a/mozilla/calendar/providers/gdata/components/calGoogleUtils.js b/mozilla/calendar/providers/gdata/components/calGoogleUtils.js index b16441a837e..f43ece0ec44 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleUtils.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleUtils.js @@ -14,8 +14,8 @@ * The Original Code is Google Calendar Provider code. * * The Initial Developer of the Original Code is - * Philipp Kewisch (mozilla@kewis.ch) - * Portions created by the Initial Developer are Copyright (C) 2006 + * Philipp Kewisch + * Portions created by the Initial Developer are Copyright (C) 2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): @@ -642,9 +642,10 @@ function getItemEditURI(aItem) { * * @param aXMLEntry The xml data of the item * @param aTimezone The timezone the event is most likely in + * @param aCalendar The calendar this item will belong to. * @return The calIEvent with the item data. */ -function XMLEntryToItem(aXMLEntry, aTimezone) { +function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) { if (aXMLEntry == null) { throw new Components.Exception("", Cr.NS_ERROR_DOM_SYNTAX_ERR); @@ -664,8 +665,13 @@ function XMLEntryToItem(aXMLEntry, aTimezone) { item.id = id.substring(id.lastIndexOf('/')+1); // link - item.setProperty("X-GOOGLE-EDITURL", - aXMLEntry.link.(@rel == 'edit').@href.toString()); + // Since Google doesn't set the edit url to be https if the request is + // https, we need to work around this here. + var editUrl = aXMLEntry.link.(@rel == 'edit').@href.toString(); + if (aCalendar.uri.schemeIs("https")) { + editUrl = editUrl.replace(/^http:/, "https:"); + } + item.setProperty("X-GOOGLE-EDITURL", editUrl); // title item.title = aXMLEntry.title.(@type == 'text');